package com.wpzf.zxhc.service.impl;


import com.alibaba.fastjson.JSON;
import com.wpzf.common.core.utils.ServletUtils;
import com.wpzf.common.core.utils.StringUtils;
import com.wpzf.common.core.utils.sign.Base64;
import com.wpzf.common.security.service.TokenService;
import com.wpzf.system.api.model.LoginUser;
import com.wpzf.zxhc.utils.MyStringUtils;
import com.wpzf.zxhc.domain.*;
import com.wpzf.zxhc.mapper.XjtbTbBaseMapper;
import com.wpzf.zxhc.mapper.YtbTbInfoMapper;
import com.wpzf.zxhc.service.XjtbTbBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.ModelMap;

import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.*;

@Service
public class XjtbTbBaseServiceImpl implements XjtbTbBaseService {
    @Autowired
    XjtbTbBaseMapper xjtbTbBaseMapper;
    @Autowired
    YtbTbInfoMapper ytbTbInfoMapper;

    @Autowired
    TokenService tokenService;

    @Override
    public List<WpCjTbxxbxj2023DTO> queryTbByxzqh(Map<String, Object> parm) {
        return xjtbTbBaseMapper.queryTbByxzqh(parm);
    }

    public WpCjTbxxbxj2023DTO querytbxxByjcbh(Map<String, Object> parm) {
        return xjtbTbBaseMapper.querytbxxByjcbh(parm);
    }

    @Override
    public ModelMap getShowImgs(Map<String, Object> parms) {
        ModelMap map = new ModelMap();
        try {
            String tbbhs = parms.get("jcbh") + "";
            String xzqdm = parms.get("xzqdm") + "";
            String pch = parms.get("pch") + "";
            String postURL = "";
            String data = "";
            String strXzqdm = parms.get("xzqdm").toString().substring(0, 2);
            {
                postURL = "https://jg.landcloud.org.cn:8553/webapi/token";
                data = "client_id=web&client_secret=e46232c20609435eba54b7576de935dd&grant_type=password&username=a53e0c14ee900728f36bba014d975982&password=b30c775c48e9ba92ade95e427a5242b0";
            }
            URL url = new URL(postURL);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("accept", "*/*");
            conn.setRequestProperty("connection", "Keep-Alive");
            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");

            conn.setDoOutput(true);
            conn.setDoInput(true);
            OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream(), "utf-8");

            out.write(data);
            //缓冲数据
            out.flush();
            //获取URLConnection对象对应的输入流
            InputStream is = conn.getInputStream();
            int count = 0;
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            byte[] buffer = new byte[4096];
            while ((count = is.read(buffer)) != -1) {
                byteArrayOutputStream.write(buffer, 0, count);
            }
            byte[] datas = byteArrayOutputStream.toByteArray();

            byteArrayOutputStream.close();
            //关闭流
            is.close();

            conn.disconnect();
            String result = new String(datas, 0, datas.length, "utf-8");
            List<String> items = new ArrayList<>();
            {
                String t = getImg(result, tbbhs, xzqdm);
                items.add(t);
                map.put("data", items);
            }
        } catch (MalformedURLException ex) {
            throw new RuntimeException(ex);
        } catch (UnsupportedEncodingException ex) {
            throw new RuntimeException(ex);
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
        return map;
    }

    @Override
    public List<YtbTbInfo> queryYtbTbInfo(Map<String, Object> parm) {
        List<YtbTbInfo> rest = new ArrayList<>();
        //参数中 获取是否有dkzt
        List<Map<String, Object>> list = ytbTbInfoMapper.queryDkxxbxj(parm);
        for (Map<String, Object> map : list) {
            YtbTbInfo ytbTbInfo = new YtbTbInfo();

            ytbTbInfo.setIndex((Long) map.get("index"));
            ytbTbInfo.setJcbh(map.get("jcbh") + "");
            ytbTbInfo.setDkbh(map.get("dkbh") + "");
            ytbTbInfo.setPch(map.get("pch") + "");
            ytbTbInfo.setXzqdm(map.get("xzqdm") + "");
            ytbTbInfo.setPdlx(map.get("pdlx") + "");
            ytbTbInfo.setJtqx(map.get("jtqx") + "");
            ytbTbInfo.setJtlx(map.get("jtlx") + "");
            ytbTbInfo.setWflx(map.get("wflx") + "");
            ytbTbInfo.setSjyt(map.get("sjyt") + "");
            ytbTbInfo.setPdyjsm(map.get("pdyjsm") + "");
            ytbTbInfo.setDkzt(map.get("dkzt") + "");
            ytbTbInfo.setXian(map.get("xian") + "");
            ytbTbInfo.setWkt(map.get("wkt") + "");

            ytbTbInfo.setNydzypzwh(map.get("nydzypzwh") != null ? map.get("nydzypzwh") + "" : "");
            ytbTbInfo.setNydzypwly(map.get("nydzypwly") != null ? map.get("nydzypwly") + "" : "");
            ytbTbInfo.setNydzypzmj(map.get("nydzypzmj") != null ? map.get("nydzypzmj") + "" : "");
            ytbTbInfo.setNydzypzjg(map.get("nydzypzjg") != null ? map.get("nydzypzjg") + "" : "");
            ytbTbInfo.setNydzypzrq(map.get("nydzypzrq") != null ? map.get("nydzypzrq") + "" : "");
            ytbTbInfo.setZjggpzwh(map.get("zjggpzwh") != null ? map.get("zjggpzwh") + "" : "");
            ytbTbInfo.setZjggpwly(map.get("zjggpwly") != null ? map.get("zjggpwly") + "" : "");
            ytbTbInfo.setZjggpzmj(map.get("zjggpzmj") != null ? map.get("zjggpzmj") + "" : "");
            ytbTbInfo.setZjggpzjg(map.get("zjggpzjg") != null ? map.get("zjggpzjg") + "" : "");
            ytbTbInfo.setZjggpzrq(map.get("zjggpzrq") != null ? map.get("zjggpzrq") + "" : "");
            ytbTbInfo.setGkfqdpzwh(map.get("gkfqdpzwh") != null ? map.get("gkfqdpzwh") + "" : "");
            ytbTbInfo.setGkfqdpwly(map.get("gkfqdpwly") != null ? map.get("gkfqdpwly") + "" : "");
            ytbTbInfo.setGkfqdpzmj(map.get("gkfqdpzmj") != null ? map.get("gkfqdpzmj") + "" : "");
            ytbTbInfo.setGkfqdpzjg(map.get("gkfqdpzjg") != null ? map.get("gkfqdpzjg") + "" : "");
            ytbTbInfo.setGkfqdpzrq(map.get("gkfqdpzrq") != null ? map.get("gkfqdpzrq") + "" : "");
            ytbTbInfo.setBdcqzspzwh(map.get("bdcqzspzwh") != null ? map.get("bdcqzspzwh") + "" : "");
            ytbTbInfo.setBdcqzspwly(map.get("bdcqzspwly") != null ? map.get("bdcqzspwly") + "" : "");
            ytbTbInfo.setBdcqzspzmj(map.get("bdcqzspzmj") != null ? map.get("bdcqzspzmj") + "" : "");
            ytbTbInfo.setBdcqzspzjg(map.get("bdcqzspzjg") != null ? map.get("bdcqzspzjg") + "" : "");
            ytbTbInfo.setBdcqzspzrq(map.get("bdcqzspzrq") != null ? map.get("bdcqzspzrq") + "" : "");
            ytbTbInfo.setSsnydpzwh(map.get("ssnydpzwh") != null ? map.get("ssnydpzwh") + "" : "");
            ytbTbInfo.setSsnydpwly(map.get("ssnydpwly") != null ? map.get("ssnydpwly") + "" : "");
            ytbTbInfo.setSsnydpzmj(map.get("ssnydpzmj") != null ? map.get("ssnydpzmj") + "" : "");
            ytbTbInfo.setSsnydpzjg(map.get("ssnydpzjg") != null ? map.get("ssnydpzjg") + "" : "");
            ytbTbInfo.setSsnydpzrq(map.get("ssnydpzrq") != null ? map.get("ssnydpzrq") + "" : "");
            ytbTbInfo.setTdzzyspzwh(map.get("tdzzyspzwh") != null ? map.get("tdzzyspzwh") + "" : "");
            ytbTbInfo.setTdzzyspwly(map.get("tdzzyspwly") != null ? map.get("tdzzyspwly") + "" : "");
            ytbTbInfo.setTdzzyspzmj(map.get("tdzzyspzmj") != null ? map.get("tdzzyspzmj") + "" : "");
            ytbTbInfo.setTdzzyspzjg(map.get("tdzzyspzjg") != null ? map.get("tdzzyspzjg") + "" : "");
            ytbTbInfo.setTdzzyspzrq(map.get("tdzzyspzrq") != null ? map.get("tdzzyspzrq") + "" : "");
            ytbTbInfo.setQtpzwh(map.get("qtpzwh") != null ? map.get("qtpzwh") + "" : "");
            ytbTbInfo.setQtpwly(map.get("qtpwly") != null ? map.get("qtpwly") + "" : "");
            ytbTbInfo.setQtpzmj(map.get("qtpzmj") != null ? map.get("qtpzmj") + "" : "");
            ytbTbInfo.setQtpzjg(map.get("qtpzjg") != null ? map.get("qtpzjg") + "" : "");
            ytbTbInfo.setQtpzrq(map.get("qtpzrq") != null ? map.get("qtpzrq") + "" : "");
            ytbTbInfo.setLsydpzwh(map.get("lsydpzwh") != null ? map.get("lsydpzwh") + "" : "");
            ytbTbInfo.setLsydpwly(map.get("lsydpwly") != null ? map.get("lsydpwly") + "" : "");
            ytbTbInfo.setLsydpzmj(map.get("lsydpzmj") != null ? map.get("lsydpzmj") + "" : "");
            ytbTbInfo.setLsydpzjg(map.get("lsydpzjg") != null ? map.get("lsydpzjg") + "" : "");
            ytbTbInfo.setLsydpzrq(map.get("lsydpzrq") != null ? map.get("lsydpzrq") + "" : "");
            ytbTbInfo.setTdgypzwh(map.get("tdgypzwh") != null ? map.get("tdgypzwh") + "" : "");
            ytbTbInfo.setTdgypwly(map.get("tdgypwly") != null ? map.get("tdgypwly") + "" : "");
            ytbTbInfo.setTdgypzmj(map.get("tdgypzmj") != null ? map.get("tdgypzmj") + "" : "");
            ytbTbInfo.setTdgypzjg(map.get("tdgypzjg") != null ? map.get("tdgypzjg") + "" : "");
            ytbTbInfo.setTdgypzrq(map.get("tdgypzrq") != null ? map.get("tdgypzrq") + "" : "");
            ytbTbInfo.setXxydpzwh(map.get("xxydpzwh") != null ? map.get("xxydpzwh") + "" : "");
            ytbTbInfo.setXxydpwly(map.get("xxydpwly") != null ? map.get("xxydpwly") + "" : "");
            ytbTbInfo.setXxydpzmj(map.get("xxydpzmj") != null ? map.get("xxydpzmj") + "" : "");
            ytbTbInfo.setXxydpzjg(map.get("xxydpzjg") != null ? map.get("xxydpzjg") + "" : "");
            ytbTbInfo.setXxydpzrq(map.get("xxydpzrq") != null ? map.get("xxydpzrq") + "" : "");
            ytbTbInfo.setYspzwh(map.get("yspzwh") != null ? map.get("yspzwh") + "" : "");
            ytbTbInfo.setYspwly(map.get("yspwly") != null ? map.get("yspwly") + "" : "");
            ytbTbInfo.setYspzmj(map.get("yspzmj") != null ? map.get("yspzmj") + "" : "");
            ytbTbInfo.setYspzjg(map.get("yspzjg") != null ? map.get("yspzjg") + "" : "");
            ytbTbInfo.setYspzrq(map.get("yspzrq") != null ? map.get("yspzrq") + "" : "");

            if (map.get("thdkmj") != null) {
                if (map.get("thdkmj").toString() != "" && map.get("thdkmj").toString() != null) {
                    ytbTbInfo.setThdkmj(Double.parseDouble(map.get("thdkmj").toString()));
                }
            }
            if (map.get("thdkgdmj") != null) {
                if (map.get("thdkgdmj").toString() != "" && map.get("thdkgdmj").toString() != null) {
                    ytbTbInfo.setThdkgdmj(Double.parseDouble(map.get("thdkgdmj").toString()));
                }
            }
            if (map.get("thdkzjbntmj") != null) {
                if (map.get("thdkzjbntmj").toString() != "" && map.get("thdkzjbntmj").toString() != null) {
                    ytbTbInfo.setThdkzjbntmj(Double.parseDouble(map.get("thdkzjbntmj").toString()));
                }
            }
            if (map.get("thnydmj") != null) {
                if (map.get("thnydmj").toString() != "" && map.get("thnydmj").toString() != null) {
                    ytbTbInfo.setThnydmj(Double.parseDouble(map.get("thnydmj").toString()));
                }
            }

            if (!"".equals(map.get("tbdkmj") + "")) {
                ytbTbInfo.setTbdkmj(Double.parseDouble(map.get("tbdkmj") + ""));
            }
            if (!"".equals(map.get("tbdkqzgdmj") + "")) {
                ytbTbInfo.setTbdkqzgdmj(Double.parseDouble(map.get("tbdkqzgdmj") + ""));
            }
            if (!"".equals(map.get("tbdkqzjbntmj") + "")) {
                ytbTbInfo.setTbdkqzjbntmj(Double.parseDouble(map.get("tbdkqzjbntmj") + ""));
            }
            if (!"".equals(map.get("tbnydmj") + "")) {
                ytbTbInfo.setTbnydmj(Double.parseDouble(map.get("tbnydmj") + ""));
            }
            if (!"".equals(map.get("tbdkstmj") + "")) {
                ytbTbInfo.setTbdkstmj(Double.parseDouble(map.get("tbdkstmj") + ""));
            }
            if (!"".equals(map.get("tbdkstbhhxmj") + "")) {
                ytbTbInfo.setTbdkstbhhxmj(Double.parseDouble(map.get("tbdkstbhhxmj") + ""));
            }
            String jcbh = map.get("jcbh") + "";
            Map<String, Object> tbxxbxj = new HashMap<>();
            if (jcbh.indexOf(",") != -1) {
                String[] s = jcbh.split(",");
                tbxxbxj = ytbTbInfoMapper.queryTbxxbxj(s[0]);
            } else {
                tbxxbxj = ytbTbInfoMapper.queryTbxxbxj(jcbh);
            }

            if (tbxxbxj != null) {
                ytbTbInfo.setTblx(tbxxbxj.get("tblx") + "");
                ytbTbInfo.setSheng(tbxxbxj.get("smc") + "");
                ytbTbInfo.setShi(tbxxbxj.get("smc1") + "");
                ytbTbInfo.setXian(tbxxbxj.get("qxmc") + "");
                ytbTbInfo.setXz(tbxxbxj.get("mjzbzddxzjxzqmc") + "");
                ytbTbInfo.setCun(tbxxbxj.get("mjzbzddcjxzqmc") + "");
                ytbTbInfo.setGjxfhzztq(tbxxbxj.get("gjxfhzztq") + "");
            }
            rest.add(ytbTbInfo);
        }
//        return ytbTbInfoMapper.queryYtbTbInfo(parm);
        return rest;
    }

    @Override
    public YtbTbInfo queryYtbTbInfoByIndex(Map<String, Object> parm) {
        return ytbTbInfoMapper.queryYtbTbInfoByIndex(parm);
    }

    @Override
    public YtbTbInfo queryYtjTbInfoByIndex(Map<String, Object> parm) {
        return ytbTbInfoMapper.queryYtjTbInfoByIndex(parm);
    }

    @Override
    public Integer queryYtbTbInfoCount(Map<String, Object> parm) {
        return ytbTbInfoMapper.queryYtbTbInfoCount(parm);
    }

    @Override
    public List<YtbTbInfo> queryYtjTbInfo(Map<String, Object> parm) {
        return ytbTbInfoMapper.queryYtjTbInfo(parm);
    }

    @Override
    public Integer queryYtjTbInfoCount(Map<String, Object> parm) {
        return ytbTbInfoMapper.queryYtjTbInfoCount(parm);
    }

    @Override
    public List<WpCjDkxxbxj2023DTO> queryWpCjDkInfoByJcbh(Map<String, Object> parm) {
        List<WpCjDkxxbxj2023DTO> rest = ytbTbInfoMapper.queryWpCjDkxxbxj2023ByJcbh(parm);
        for (WpCjDkxxbxj2023DTO wpCjDkxxbxj2023DTO : rest) {
            List<WpCjDkxxbxjPw2023DTO> wpCjDkxxbxjPw2023DTOS = ytbTbInfoMapper.queryWpCjDkxxbxjPw2023(wpCjDkxxbxj2023DTO);
            if (wpCjDkxxbxjPw2023DTOS.size() > 0 && wpCjDkxxbxj2023DTO != null) {
                wpCjDkxxbxj2023DTO.setHfpwlist(wpCjDkxxbxjPw2023DTOS);
            }
        }
        return rest;
    }

    /*@Override
    public List<WpCjDkxxbxj2023DTO> queryWpCjWtgDkInfoByJcbh(Map<String, Object> parm) {
        List<WpCjDkxxbxj2023DTO> rest = ytbTbInfoMapper.queryWpCjDkxxbxj2023ByJcbh(parm);
        for (WpCjDkxxbxj2023DTO wpCjDkxxbxj2023DTO : rest) {
            if ("合法".equals(wpCjDkxxbxj2023DTO.getPdlx())) {
                //wpCjDkxxbxj2023DTO.setHfpwList(ytbTbInfoMapper.queryWpCjDkxxbxjHfpw2023ByDkbh(wpCjDkxxbxj2023DTO));
            }
        }
        return rest;
    }*/

    @Override
    public List<Map<String, Object>> queryWpCjDkInfoByJcbhToHsMap(Map<String, Object> parm) {
        List<WpCjDkxxbxj2023DTO> dkxxbxj2023DTOS = ytbTbInfoMapper.queryWpCjDkInfoByJcbh(parm);
        List<Map<String, Object>> listHashMap = new ArrayList<>();
        for (int i = 0; i < dkxxbxj2023DTOS.size(); i++) {
            Map<String, Object> hsMap = new HashMap<>();
            Map<String, Object> dktbxx = new HashMap<>();
//            dktbxx.put("dkbh", dkxxbxj2023DTOS.get(i).getDkbh());
//            dktbxx.put("hfNydmj", dkxxbxj2023DTOS.get(i).getHfNydmj());
//            dktbxx.put("hfQzgdmj", dkxxbxj2023DTOS.get(i).getHfQzgdmj());
//            dktbxx.put("hfYjjbntmj", dkxxbxj2023DTOS.get(i).getHfYjjbntmj());
//            dktbxx.put("qzstmj", "");
//            dktbxx.put("hfStbhhxmj", dkxxbxj2023DTOS.get(i).getHfStbhhxmj());
//            dktbxx.put("dkwyhsxx", "");
            Map<String, Object> hf = new HashMap<>();
//            hf.put("hfJtqx", dkxxbxj2023DTOS.get(i).getHfJtqx());
//            hf.put("hfJtlx", dkxxbxj2023DTOS.get(i).getHfJtlx());
//            hf.put("hfHfydsjyt", dkxxbxj2023DTOS.get(i).getHfHfydsjyt());
//            hf.put("pdlx", dkxxbxj2023DTOS.get(i).getPdlx());
//            hf.put("hfHfydpw", dkxxbxj2023DTOS.get(i).getHfHfydpw());
//            hf.put("key", System.currentTimeMillis());
            Map<String, Object> wf = new HashMap<>();
//            wf.put("wflx1j", dkxxbxj2023DTOS.get(i).getWfWflx());
//            wf.put("wflx2j", dkxxbxj2023DTOS.get(i).getWfWflx());
//            wf.put("wflx3j", dkxxbxj2023DTOS.get(i).getWfWflx());
//            wf.put("wflx4j", dkxxbxj2023DTOS.get(i).getWfWflx());
//            wf.put("wfSfxzlzgdjf", dkxxbxj2023DTOS.get(i).getWfSfxzlzgdjf());
//            wf.put("wfSfwhzj", dkxxbxj2023DTOS.get(i).getWfSfwhzj());
//            wf.put("wfSfdpf", dkxxbxj2023DTOS.get(i).getWfSfdpf());
//            wf.put("wfSjyt", dkxxbxj2023DTOS.get(i).getWfSjyt());
//            wf.put("wfPdyjsm", dkxxbxj2023DTOS.get(i).getWfPdyjsm());
//            wf.put("wfXmlx", dkxxbxj2023DTOS.get(i).getWfXmlx());
//            wf.put("wfXmmc", dkxxbxj2023DTOS.get(i).getWfXmmc());
//            wf.put("wfXmzt", dkxxbxj2023DTOS.get(i).getWfXmzt());
//            wf.put("wfLxpzjg", dkxxbxj2023DTOS.get(i).getWfLxpzjg());
//            wf.put("wfLxpzwh", dkxxbxj2023DTOS.get(i).getWfLxpzwh());
//            wf.put("key", System.currentTimeMillis());
            Map<String, Object> qt = new HashMap<>();
//            qt.put("qtJtqk", dkxxbxj2023DTOS.get(i).getQtJtqk());
//            qt.put("qtJtlx", dkxxbxj2023DTOS.get(i).getQtJtlx());
//            qt.put("qtPdyjsm", dkxxbxj2023DTOS.get(i).getQtPdyjsm());
//            qt.put("key", System.currentTimeMillis());
            hsMap.put("dktbxx", dktbxx);
            hsMap.put("hf", hf);
            hsMap.put("qt", qt);
            hsMap.put("wf", wf);
            listHashMap.add(hsMap);
        }
        return listHashMap;
    }

    @Override
    public List<Map> getYtbPch(Map<String, Object> parm) {
        return xjtbTbBaseMapper.getYtbPch(parm);
    }

    @Override
    public List<Map> getYtjPch(Map<String, Object> parm) {
        return xjtbTbBaseMapper.getYtjPch(parm);
    }

    @Override
    public List<Map> getPch(Map<String, Object> parm) {
        return xjtbTbBaseMapper.getPch(parm);
    }

    @Override
    public Integer getNotSaveCount(Map<String, Object> parm) {
        return xjtbTbBaseMapper.getNotSaveCount(parm);
    }

    @Override
    public Integer updateTask(Map<String, Object> parm) {
        List<Map<String, Object>> taskList = xjtbTbBaseMapper.getTaskByXzqdm(parm);
        for (Map<String, Object> task : taskList) {
            task.put("czr", parm.get("username"));
            task.put("czsj", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
            task.put("result", "合格");
            task.put("userlevel", "县");
            xjtbTbBaseMapper.saveDkxxbxjlz(task);
            task.put("dkzt", "2");
            xjtbTbBaseMapper.updateDkxxbDkzt(task);
        }
        return xjtbTbBaseMapper.updateTask(parm);
    }

    @Override
    public Integer addDkxxbXjData(Map<String, Object> parm) {
        Integer rest = 0;
        String jcbh = parm.get("jcbh").toString();
        String pch = parm.get("pch").toString();
        String xzqdm = parm.get("xzqdm").toString();
        //先全部删除
        Integer value = xjtbTbBaseMapper.deleteDkxxbXjData(parm);
        if (value >= 0) //删除成功
        {
            xjtbTbBaseMapper.deleteDkxxbXjHfpwData(parm);
            //rest = xjtbTbBaseMapper.updateTbxxbXjSaveState(parm);
            List<Map<String, Object>> list = (List<Map<String, Object>>) parm.get("lists");
            if (list != null && list.size() > 0) {
                for (Map<String, Object> map : list) {
                    String dkbh = map.get("dkbh") + "";
                    if (dkbh.indexOf(",") != -1) {
                        String[] arr = dkbh.split(",");
                        for (String s : arr) {
                            Map<String, Object> m = new HashMap();
                            xjtbTbBaseMapper.updateDkxxbXjIsdelState(m);
//                            xjtbTbBaseMapper.deleteDkxxbXjHfpwData(s);
                        }
                    }

                    map.put("isdel", "0");
                    map.put("pch", pch);
                    map.put("xzqdm", xzqdm);
                    map.put("submitdate", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
                    List<Map<String, Object>> hfpwList = (List<Map<String, Object>>) map.get("hfpwList");
                    map.put("hf_hfydpw", 0);

                    if (hfpwList != null && hfpwList.size() > 0) {
                        map.put("hf_hfydpw", hfpwList.size());
                        int sort = 0;
                        for (Map<String, Object> m : hfpwList) {
                            m.put("dkbh", map.get("dkbh"));
                            m.put("sort", sort++);
                            m.put("jcbh", jcbh);
                            m.put("pch", pch);
                            m.put("xzqdm", xzqdm);
                            xjtbTbBaseMapper.addDkxxbXjHfpwData(m);
                        }
                    }
                    map.put("dkzt", "1");
                    xjtbTbBaseMapper.addDkxxbXjData(map);
                }
            }
        }
        return rest;
    }

    @Override
    public List<Map<String, Object>> getDkbhByJcbh(Map<String, Object> parm) {
        return xjtbTbBaseMapper.getDkbhByJcbh(parm);
    }

    @Override
    public List<Map<String, Object>> querytbxxByjcbhidx(ModelMap model) {
        return xjtbTbBaseMapper.querytbxxByjcbhidx(model);
    }

    @Override
    public Integer addDkxxbXjDatadg(Map<String, Object> parm) {
        Integer rest = 0;
        String jcbh = parm.get("jcbh").toString();
        String pch = parm.get("pch").toString();
        String xzqdm = parm.get("xzqdm").toString();
        String olddkbh = parm.get("olddkbh").toString();

        String pwgs = "";
        //农专用
        String nydzypzwh = "";
        String nydzypwly = "";
        String nydzypzmj = "";
        String nydzypzjg = "";
        String nydzypzrq = "";

        String nydzytdgypwlxejl = "";
        String nydzypwlb = "";
        String nydzypznydmj = "";
        String nydzypzgdmj = "";
        String nydzypzyjjbntmj = "";

        //增减挂钩
        String zjggpzwh = "";
        String zjggpwly = "";
        String zjggpzmj = "";
        String zjggpzjg = "";
        String zjggpzrq = "";

        String zjggtdgypwlxejl = "";
        String zjggpwlb = "";
        String zjggpznydmj = "";
        String zjggpzgdmj = "";
        String zjggpzyjjbntmj = "";

        //工矿废弃地
        String gkfqdpzwh = "";
        String gkfqdpwly = "";
        String gkfqdpzmj = "";
        String gkfqdpzjg = "";
        String gkfqdpzrq = "";

        String gkfqdtdgypwlxejl = "";
        String gkfqdpwlb = "";
        String gkfqdpznydmj = "";
        String gkfqdpzgdmj = "";
        String gkfqdpzyjjbntmj = "";

        //不动产权证书
        String bdcqzspzwh = "";
        String bdcqzspwly = "";
        String bdcqzspzmj = "";
        String bdcqzspzjg = "";
        String bdcqzspzrq = "";

        String bdcqzstdgypwlxejl = "";
        String bdcqzspwlb = "";
        String bdcqzsznydmj = "";
        String bdcqzspzgdmj = "";
        String bdcqzspzzyjjbntmj = "";

        //设施农用地
        String ssnydpzwh = "";
        String ssnydpwly = "";
        String ssnydpzmj = "";
        String ssnydpzjg = "";
        String ssnydpzrq = "";


        String ssnydtdgypwlxejl = "";
        String ssnydpwlb = "";
        String ssnydpznydmj = "";
        String ssnydpzgdmj = "";
        String ssnydpzyjjbntmj = "";

        //土地整治验收
        String tdzzyspzwh = "";
        String tdzzyspwly = "";
        String tdzzyspzmj = "";
        String tdzzyspzjg = "";
        String tdzzyspzrq = "";

        String tdzzystdgypwlxejl = "";
        String tdzzyspwlb = "";
        String tdzzyspznydmj = "";
        String tdzzyspzgdmj = "";
        String tdzzyspzyjjbntmj = "";

        //其他
        String qtpzwh = "";
        String qtpwly = "";
        String qtpzmj = "";
        String qtpzjg = "";
        String qtpzrq = "";

        String qttdgypwlxejl = "";
        String qtpwlb = "";
        String qtpznydmj = "";
        String qtpzgdmj = "";
        String qtpzyjjbntmj = "";

        //临时用地
        String lsydpzwh = "";
        String lsydpwly = "";
        String lsydpzmj = "";
        String lsydpzjg = "";
        String lsydpzrq = "";

        String lsydtdgypwlxejl = "";
        String lsydpwlb = "";
        String lsydpznydmj = "";
        String lsydpzgdmj = "";
        String lsydpzyjjbntmj = "";

        //土地供应
        String tdgypzwh = "";
        String tdgypwly = "";
        String tdgypzmj = "";
        String tdgypzjg = "";
        String tdgypzrq = "";

        String tdgytdgypwlxejl = "";
        String tdgypwlb = "";
        String tdgypznydmj = "";
        String tdgypzgdmj = "";
        String tdgypzyjjbntmj = "";

        //先行用地
        String xxydpzwh = "";
        String xxydpwly = "";
        String xxydpzmj = "";
        String xxydpzjg = "";
        String xxydpzrq = "";

        String xxydtdgypwlxejl = "";
        String xxydpwlb = "";
        String xxydpznydmj = "";
        String xxydpzgdmj = "";
        String xxydpzyjjbntmj = "";

        //预审
        String yspzwh = "";
        String yspwly = "";
        String yspzmj = "";
        String yspzjg = "";
        String yspzrq = "";

        String ystdgypwlxejl = "";
        String yspwlb = "";
        String yspznydmj = "";
        String yspzgdmj = "";
        String yspzyjjbntmj = "";


        List<Map<String, Object>> list = (List<Map<String, Object>>) parm.get("lists");
        if (list != null && list.size() > 0) {
            for (Map<String, Object> map : list) {
                //更新 信息

                List<Map<String, Object>> hfpwList = (List<Map<String, Object>>) map.get("hfpwlist");
                if (hfpwList != null && hfpwList.size() > 0) {

                    map.put("hf_hfydpw", hfpwList.size());

                    if (hfpwList != null && hfpwList.size() > 0) {
                        int sort = 0;
                        xjtbTbBaseMapper.deleteDkxxbxjPw(map);
                        for (Map<String, Object> m : hfpwList) {
                            m.put("sort", sort++);
                            m.put("dkbh", map.get("dkbh"));
                            m.put("tbbh", map.get("dkbh"));
                            m.put("jcbh", jcbh);
                            m.put("pch", pch);
                            m.put("xzqdm", xzqdm);

                            xjtbTbBaseMapper.saveDkxxbxjPw(m);
                            if (m.get("hf_pwlx").toString().equals("农用地转用")) {
                                nydzypzwh += m.get("hf_pzwh").toString() + ",";
                                nydzypwly += m.get("hf_pwly").toString() + ",";
                                nydzypzmj += m.get("hf_pzmj").toString() + ",";
                                //nydzypzjg+=m.get("hf_pzjg").toString()+",";
                                nydzypzrq += m.get("hf_pzrq").toString() + ",";

                                nydzytdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                nydzypwlb += m.get("hf_pwlb").toString() + ",";
                                nydzypznydmj += m.get("hf_pznydmj").toString() + ",";
                                nydzypzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                nydzypzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("增减挂钩")) {
                                zjggpzwh += m.get("hf_pzwh").toString() + ",";
                                zjggpwly += m.get("hf_pwly").toString() + ",";
                                zjggpzmj += m.get("hf_pzmj").toString() + ",";
                                //zjggpzjg+=m.get("hf_pzjg").toString()+",";
                                zjggpzrq += m.get("hf_pzrq").toString() + ",";

                                zjggtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                zjggpwlb += m.get("hf_pwlb").toString() + ",";
                                zjggpznydmj += m.get("hf_pznydmj").toString() + ",";
                                zjggpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                zjggpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("工矿废弃地")) {
                                gkfqdpzwh += m.get("hf_pzwh").toString() + ",";
                                gkfqdpwly += m.get("hf_pwly").toString() + ",";
                                gkfqdpzmj += m.get("hf_pzmj").toString() + ",";
                                //gkfqdpzjg+=m.get("hf_pzjg").toString()+",";
                                gkfqdpzrq += m.get("hf_pzrq").toString() + ",";

                                gkfqdtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                gkfqdpwlb += m.get("hf_pwlb").toString() + ",";
                                gkfqdpznydmj += m.get("hf_pznydmj").toString() + ",";
                                gkfqdpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                gkfqdpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("不动产权证书")) {

                                bdcqzspzwh += m.get("hf_pzwh").toString() + ",";
                                bdcqzspwly += m.get("hf_pwly").toString() + ",";
                                bdcqzspzmj += m.get("hf_pzmj").toString() + ",";
                                //bdcqzspzjg+=m.get("hf_pzjg").toString()+",";
                                bdcqzspzrq += m.get("hf_pzrq").toString() + ",";

                                bdcqzstdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                bdcqzspwlb += m.get("hf_pwlb").toString() + ",";
                                bdcqzsznydmj += m.get("hf_pznydmj").toString() + ",";
                                bdcqzspzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                bdcqzspzzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("设施农用地")) {
                                ssnydpzwh += m.get("hf_pzwh").toString() + ",";
                                ssnydpwly += m.get("hf_pwly").toString() + ",";
                                ssnydpzmj += m.get("hf_pzmj").toString() + ",";
                                //ssnydpzjg+=m.get("hf_pzjg").toString()+",";
                                ssnydpzrq += m.get("hf_pzrq").toString() + ",";

                                ssnydtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                ssnydpwlb += m.get("hf_pwlb").toString() + ",";
                                ssnydpznydmj += m.get("hf_pznydmj").toString() + ",";
                                ssnydpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                ssnydpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("土地整治验收")) {
                                tdzzyspzwh += m.get("hf_pzwh").toString() + ",";
                                tdzzyspwly += m.get("hf_pwly").toString() + ",";
                                tdzzyspzmj += m.get("hf_pzmj").toString() + ",";
                                //tdzzyspzjg+=m.get("hf_pzjg").toString()+",";
                                tdzzyspzrq += m.get("hf_pzrq").toString() + ",";

                                tdzzystdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                tdzzyspwlb += m.get("hf_pwlb").toString() + ",";
                                tdzzyspznydmj += m.get("hf_pznydmj").toString() + ",";
                                tdzzyspzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                tdzzyspzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";

                            } else if (m.get("hf_pwlx").toString().equals("其他")) {
                                qtpzwh += m.get("hf_pzwh").toString() + ",";
                                qtpwly += m.get("hf_pwly").toString() + ",";
                                qtpzmj += m.get("hf_pzmj").toString() + ",";
                                //qtpzjg+=m.get("hf_pzjg").toString()+",";
                                qtpzrq += m.get("hf_pzrq").toString() + ",";

                                qttdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                qtpwlb += m.get("hf_pwlb").toString() + ",";
                                qtpznydmj += m.get("hf_pznydmj").toString() + ",";
                                qtpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                qtpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("临时用地")) {
                                lsydpzwh += m.get("hf_pzwh").toString() + ",";
                                lsydpwly += m.get("hf_pwly").toString() + ",";
                                lsydpzmj += m.get("hf_pzmj").toString() + ",";
                                //lsydpzjg+=m.get("hf_pzjg").toString()+",";
                                lsydpzrq += m.get("hf_pzrq").toString() + ",";

                                lsydtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                lsydpwlb += m.get("hf_pwlb").toString() + ",";
                                lsydpznydmj += m.get("hf_pznydmj").toString() + ",";
                                lsydpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                lsydpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";

                            } else if (m.get("hf_pwlx").toString().equals("土地供应")) {
                                tdgypzwh += m.get("hf_pzwh").toString() + ",";
                                tdgypwly += m.get("hf_pwly").toString() + ",";
                                tdgypzmj += m.get("hf_pzmj").toString() + ",";
                                //tdgypzjg+=m.get("hf_pzjg").toString()+",";
                                tdgypzrq += m.get("hf_pzrq").toString() + ",";

                                tdgytdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                tdgypwlb += m.get("hf_pwlb").toString() + ",";
                                tdgypznydmj += m.get("hf_pznydmj").toString() + ",";
                                tdgypzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                tdgypzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("先行用地")) {
                                //先行用地
                                xxydpzwh += m.get("hf_pzwh").toString() + ",";
                                xxydpwly += m.get("hf_pwly").toString() + ",";
                                xxydpzmj += m.get("hf_pzmj").toString() + ",";
                                //xxydpzjg+=m.get("hf_pzjg").toString()+",";
                                xxydpzrq += m.get("hf_pzrq").toString() + ",";

                                xxydtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                xxydpwlb += m.get("hf_pwlb").toString() + ",";
                                xxydpznydmj += m.get("hf_pznydmj").toString() + ",";
                                xxydpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                xxydpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("预审")) {
                                yspzwh += m.get("hf_pzwh").toString() + ",";
                                yspwly += m.get("hf_pwly").toString() + ",";
                                yspzmj += m.get("hf_pzmj").toString() + ",";
                                //yspzjg+=m.get("hf_pzjg").toString()+",";
                                yspzrq += m.get("hf_pzrq").toString() + ",";

                                ystdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                yspwlb += m.get("hf_pwlb").toString() + ",";
                                yspznydmj += m.get("hf_pznydmj").toString() + ",";
                                yspzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                yspzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            }
                        }
                    }

                    map.put("pwgs", hfpwList.size());
                } else {
                    map.put("pwgs", 0);
                }

                map.put("nydzypzwh", nydzypzwh);
                map.put("nydzypwly", nydzypwly);
                map.put("nydzypzmj", nydzypzmj);
                map.put("nydzypzjg", nydzypzjg);
                map.put("nydzypzrq", nydzypzrq);
                map.put("nydzytdgypwlxejl", nydzytdgypwlxejl);
                map.put("nydzypwlb", nydzypwlb);
                map.put("nydzypznydmj", nydzypznydmj);
                map.put("nydzypzgdmj", nydzypzgdmj);
                map.put("nydzypzyjjbntmj", nydzypzyjjbntmj);


                map.put("zjggpzwh", zjggpzwh);
                map.put("zjggpwly", zjggpwly);
                map.put("zjggpzmj", zjggpzmj);
                map.put("zjggpzjg", zjggpzjg);
                map.put("zjggpzrq", zjggpzrq);
                map.put("zjggtdgypwlxejl", zjggtdgypwlxejl);
                map.put("zjggpwlb", zjggpwlb);
                map.put("zjggpznydmj", zjggpznydmj);
                map.put("zjggpzgdmj", zjggpzgdmj);
                map.put("zjggpzyjjbntmj", zjggpzyjjbntmj);
                if ("null".equals(map.get("qtjtqx")+"")) {
                    map.put("qtsjytyjmc","");
                } else {
                    map.put("qtsjytyjmc",map.get("qtjtqx").toString());
                };

                map.put("gkfqdpzwh", gkfqdpzwh);
                map.put("gkfqdpwly", gkfqdpwly);
                map.put("gkfqdpzmj", gkfqdpzmj);
                map.put("gkfqdpzjg", gkfqdpzjg);
                map.put("gkfqdpzrq", gkfqdpzrq);
                map.put("gkfqdtdgypwlxejl", gkfqdtdgypwlxejl);
                map.put("gkfqdpwlb", gkfqdpwlb);
                map.put("gkfqdpznydmj", gkfqdpznydmj);
                map.put("gkfqdpzgdmj", gkfqdpzgdmj);
                map.put("gkfqdpzyjjbntmj", gkfqdpzyjjbntmj);


                map.put("bdcqzspzwh", bdcqzspzwh);
                map.put("bdcqzspwly", bdcqzspwly);
                map.put("bdcqzspzmj", bdcqzspzmj);
                map.put("bdcqzspzjg", bdcqzspzjg);
                map.put("bdcqzspzrq", bdcqzspzrq);
                map.put("bdcqzstdgypwlxejl", bdcqzstdgypwlxejl);
                map.put("bdcqzspwlb", bdcqzspwlb);
                map.put("bdcqzsznydmj", bdcqzsznydmj);
                map.put("bdcqzspzgdmj", bdcqzspzgdmj);
                map.put("bdcqzspzzyjjbntmj", bdcqzspzzyjjbntmj);


                map.put("ssnydpzwh", ssnydpzwh);
                map.put("ssnydpwly", ssnydpwly);
                map.put("ssnydpzmj", ssnydpzmj);
                map.put("ssnydpzjg", ssnydpzjg);
                map.put("ssnydpzrq", ssnydpzrq);
                map.put("ssnydtdgypwlxejl", ssnydtdgypwlxejl);
                map.put("ssnydpwlb", ssnydpwlb);
                map.put("ssnydpznydmj", ssnydpznydmj);
                map.put("ssnydpzgdmj", ssnydpzgdmj);
                map.put("ssnydpzyjjbntmj", ssnydpzyjjbntmj);


                map.put("tdzzyspzwh", tdzzyspzwh);
                map.put("tdzzyspwly", tdzzyspwly);
                map.put("tdzzyspzmj", tdzzyspzmj);
                map.put("tdzzyspzjg", tdzzyspzjg);
                map.put("tdzzyspzrq", tdzzyspzrq);
                map.put("tdzzystdgypwlxejl", tdzzystdgypwlxejl);
                map.put("tdzzyspwlb", tdzzyspwlb);
                map.put("tdzzyspznydmj", tdzzyspznydmj);
                map.put("tdzzyspzgdmj", tdzzyspzgdmj);
                map.put("tdzzyspzyjjbntmj", tdzzyspzyjjbntmj);


                map.put("qtpzwh", qtpzwh);
                map.put("qtpwly", qtpwly);
                map.put("qtpzmj", qtpzmj);
                map.put("qtpzjg", qtpzjg);
                map.put("qtpzrq", qtpzrq);
                map.put("qttdgypwlxejl", qttdgypwlxejl);
                map.put("qtpwlb", qtpwlb);
                map.put("qtpznydmj", qtpznydmj);
                map.put("qtpzgdmj", qtpzgdmj);
                map.put("qtpzyjjbntmj", qtpzyjjbntmj);

                map.put("lsydpzwh", lsydpzwh);
                map.put("lsydpwly", lsydpwly);
                map.put("lsydpzmj", lsydpzmj);
                map.put("lsydpzjg", lsydpzjg);
                map.put("lsydpzrq", lsydpzrq);
                map.put("lsydtdgypwlxejl", lsydtdgypwlxejl);
                map.put("lsydpwlb", lsydpwlb);
                map.put("lsydpznydmj", lsydpznydmj);
                map.put("lsydpzgdmj", lsydpzgdmj);
                map.put("lsydpzyjjbntmj", lsydpzyjjbntmj);


                map.put("tdgypzwh", tdgypzwh);
                map.put("tdgypwly", tdgypwly);
                map.put("tdgypzmj", tdgypzmj);
                map.put("tdgypzjg", tdgypzjg);
                map.put("tdgypzrq", tdgypzrq);
                map.put("tdgytdgypwlxejl", tdgytdgypwlxejl);
                map.put("tdgypwlb", tdgypwlb);
                map.put("tdgypznydmj", tdgypznydmj);
                map.put("tdgypzgdmj", tdgypzgdmj);
                map.put("tdgypzyjjbntmj", tdgypzyjjbntmj);


                map.put("xxydpzwh", xxydpzwh);
                map.put("xxydpwly", xxydpwly);
                map.put("xxydpzmj", xxydpzmj);
                map.put("xxydpzjg", xxydpzjg);
                map.put("xxydpzrq", xxydpzrq);
                map.put("xxydtdgypwlxejl", xxydtdgypwlxejl);
                map.put("xxydpwlb", xxydpwlb);
                map.put("xxydpznydmj", xxydpznydmj);
                map.put("xxydpzgdmj", xxydpzgdmj);
                map.put("xxydpzyjjbntmj", xxydpzyjjbntmj);


                map.put("yspzwh", yspzwh);
                map.put("yspwly", yspwly);
                map.put("yspzmj", yspzmj);
                map.put("yspzjg", yspzjg);
                map.put("yspzrq", yspzrq);
                map.put("ystdgypwlxejl", ystdgypwlxejl);
                map.put("yspwlb", yspwlb);
                map.put("yspznydmj", yspznydmj);
                map.put("yspzgdmj", yspzgdmj);
                map.put("yspzyjjbntmj", yspzyjjbntmj);


                map.put("isdel", "0");
                map.put("pch", pch);
                map.put("xzqdm", xzqdm);
                map.put("submitdate", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
                map.put("tbbh", map.get("dkbh").toString());
                map.put("dkzt", "2");
                Map<String, Object> map1 = new HashMap<>();
                if (map.get("dkbh").toString().equals(olddkbh)) {
                    rest = xjtbTbBaseMapper.updateDkxxb(map);
                }  //前期已经有了  直接更新
                else  //前期没有 则先删除 再合并
                {
                    String[] tbbhs = map.get("dkbh").toString().split(",");
                    if (tbbhs.length > 0) {
                        for (int k = 0; k < tbbhs.length; k++) {
                            String dkbh = tbbhs[k].toString();

                            map1.put("dkbh", dkbh);
                            int mm = xjtbTbBaseMapper.deleteDkxxbXjByDkbh(map1);//全部删除
                        }
                    }
                    map1.put("dkbh", map.get("dkbh").toString());
                    int mm = xjtbTbBaseMapper.deleteDkxxbXjByDkbh(map1);//全部删除

                    map.put("uid", UUID.randomUUID().toString().replace("-", ""));

                    rest = xjtbTbBaseMapper.addDkxxbXjData12(map);
                }
                if (rest > 0) {
                    map.put("czr", parm.get("czr"));
                    map.put("realname", parm.get("realname"));
                    map.put("czsj", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
                    map.put("result", "合格");
                    map.put("userlevel", "县");
                    xjtbTbBaseMapper.saveDkxxbxjlz(map);
                }
            }
        }
        return rest;
    }

    public Integer saveXjWtgDk(Map<String, Object> map) {
        Integer rest = 0;
        String hcjgsm = map.get("hcjgsm") + "";
        if (
                "提供证明文件不可作为新增建设判定依据".equals(hcjgsm) ||
                        "现状不符合实地未变化认定标准".equals(hcjgsm) ||
                        "明显建设用地".equals(hcjgsm) ||
                        "拆除不到位".equals(hcjgsm) ||
                        "复耕不到位".equals(hcjgsm) ||
                        "虚假复耕".equals(hcjgsm) ||
                        "提供证明材料不全（仅提供批准文号）".equals(hcjgsm) ||
                        "提供证明材料不全（填报文号与扫描件不一致）".equals(hcjgsm) ||
                        "提供证明材料不全（自录批文位置矢量部分套合）".equals(hcjgsm) ||
                        "提供证明材料不全（未提供自录批文位置矢量）".equals(hcjgsm) ||
                        "提供证明材料不全（自录批文位置矢量批准文号为空）".equals(hcjgsm) ||
                        "提供证明材料不全（提供矢量与批准文件不符）".equals(hcjgsm) ||
                        "自录批文批准占用耕地面积小于无手续耕地面积".equals(hcjgsm) ||
                        "对监督平台未套合部分无举证材料".equals(hcjgsm) ||
                        "未提供临时用地审批文件".equals(hcjgsm) ||
                        "未提供临时用地审批文件（临时用地位置矢量部分套合）".equals(hcjgsm) ||
                        "未提供临时用地审批文件（未提供临时用地位置矢量）".equals(hcjgsm) ||
                        "未提供临时用地审批文件（临时用地位置矢量与批准文件不符）".equals(hcjgsm) ||
                        "光伏用地占用耕地".equals(hcjgsm) ||
                        "光伏用地占用永久基本农田".equals(hcjgsm) ||
                        "光伏用地占用耕地，提供备案文件不合理".equals(hcjgsm) ||
                        "光伏用地占用耕地，未提供备案文件".equals(hcjgsm)) {
            map.put("submitdate", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
            xjtbTbBaseMapper.updateDkxxbXjTjState(map);
            rest = xjtbTbBaseMapper.saveXjWtgDk(map);
        }
        return rest;
    }

    public List<Map<String, Object>> getWtgPch(Map<String, Object> parm) {
        return xjtbTbBaseMapper.getWtgPch(parm);
    }

    public List<Map<String, Object>> queryXjWtgDk(Map<String, Object> parm) {
        return xjtbTbBaseMapper.queryXjWtgDk(parm);
    }

    public Integer queryXjWtgDkCount(Map<String, Object> parm) {
        return xjtbTbBaseMapper.queryXjWtgDkCount(parm);
    }

    public Map<String, Object> queryXjWtgDkByIndex(Map<String, Object> parm) {
        return xjtbTbBaseMapper.queryXjWtgDkByIndex(parm);
    }

    @Override
    public Integer addWtgDkData(Map<String, Object> parm) {
        Integer rest = 0;
        String jcbh = parm.get("jcbh").toString();
        String pch = parm.get("pch").toString();
        String xzqdm = parm.get("xzqdm").toString();
        if ((parm.get("dkbh").toString()) != "") {
            xjtbTbBaseMapper.deleteDkxxbXjByDkbh(parm);
            xjtbTbBaseMapper.deleteDkxxbXjHfpwData(parm);
        }

        List<Map<String, Object>> list = (List<Map<String, Object>>) parm.get("lists");
        if (list != null && list.size() > 0) {
            for (Map<String, Object> map : list) {
                String dkbh = map.get("dkbh") + ""; //获取当前地块编号
                map.put("isdel", "0");
                map.put("pch", pch);
                map.put("xzqdm", xzqdm);
                map.put("submitdate", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
                List<Map<String, Object>> hfpwList = (List<Map<String, Object>>) map.get("hfpwList");
                if (hfpwList != null && hfpwList.size() > 0) {
                    map.put("hf_hfydpw", hfpwList.size());

                    if (hfpwList != null && hfpwList.size() > 0) {
                        int sort = 0;
                        for (Map<String, Object> m : hfpwList) {
                            m.put("dkbh", map.get("dkbh"));
                            m.put("sort", sort++);
                            m.put("jcbh", jcbh);
                            m.put("pch", pch);
                            m.put("xzqdm", xzqdm);
                            xjtbTbBaseMapper.addDkxxbXjHfpwData(m);
                        }
                    }
                }
                map.put("dkzt", "4");
                rest = xjtbTbBaseMapper.addDkxxbXjData(map);
                map.put("sfhc_submitdate", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
                xjtbTbBaseMapper.updateDkxxbXjSfhcState(map);
            }
        }
        return rest;
    }

    public Integer wtgdkSubmit(Map<String, Object> parm) {
        Integer rest = 0;
        String jcbh = parm.get("jcbh").toString();
        String pch = parm.get("pch").toString();
        String xzqdm = parm.get("xzqdm").toString();
        String olddkbh = parm.get("olddkbh").toString();

        String pwgs = "";
        //农专用
        String nydzypzwh = "";
        String nydzypwly = "";
        String nydzypzmj = "";
        String nydzypzjg = "";
        String nydzypzrq = "";

        String nydzytdgypwlxejl = "";
        String nydzypwlb = "";
        String nydzypznydmj = "";
        String nydzypzgdmj = "";
        String nydzypzyjjbntmj = "";

        //增减挂钩
        String zjggpzwh = "";
        String zjggpwly = "";
        String zjggpzmj = "";
        String zjggpzjg = "";
        String zjggpzrq = "";

        String zjggtdgypwlxejl = "";
        String zjggpwlb = "";
        String zjggpznydmj = "";
        String zjggpzgdmj = "";
        String zjggpzyjjbntmj = "";

        //工矿废弃地
        String gkfqdpzwh = "";
        String gkfqdpwly = "";
        String gkfqdpzmj = "";
        String gkfqdpzjg = "";
        String gkfqdpzrq = "";

        String gkfqdtdgypwlxejl = "";
        String gkfqdpwlb = "";
        String gkfqdpznydmj = "";
        String gkfqdpzgdmj = "";
        String gkfqdpzyjjbntmj = "";

        //不动产权证书
        String bdcqzspzwh = "";
        String bdcqzspwly = "";
        String bdcqzspzmj = "";
        String bdcqzspzjg = "";
        String bdcqzspzrq = "";

        String bdcqzstdgypwlxejl = "";
        String bdcqzspwlb = "";
        String bdcqzsznydmj = "";
        String bdcqzspzgdmj = "";
        String bdcqzspzzyjjbntmj = "";

        //设施农用地
        String ssnydpzwh = "";
        String ssnydpwly = "";
        String ssnydpzmj = "";
        String ssnydpzjg = "";
        String ssnydpzrq = "";


        String ssnydtdgypwlxejl = "";
        String ssnydpwlb = "";
        String ssnydpznydmj = "";
        String ssnydpzgdmj = "";
        String ssnydpzyjjbntmj = "";

        //土地整治验收
        String tdzzyspzwh = "";
        String tdzzyspwly = "";
        String tdzzyspzmj = "";
        String tdzzyspzjg = "";
        String tdzzyspzrq = "";

        String tdzzystdgypwlxejl = "";
        String tdzzyspwlb = "";
        String tdzzyspznydmj = "";
        String tdzzyspzgdmj = "";
        String tdzzyspzyjjbntmj = "";

        //其他
        String qtpzwh = "";
        String qtpwly = "";
        String qtpzmj = "";
        String qtpzjg = "";
        String qtpzrq = "";

        String qttdgypwlxejl = "";
        String qtpwlb = "";
        String qtpznydmj = "";
        String qtpzgdmj = "";
        String qtpzyjjbntmj = "";

        //临时用地
        String lsydpzwh = "";
        String lsydpwly = "";
        String lsydpzmj = "";
        String lsydpzjg = "";
        String lsydpzrq = "";

        String lsydtdgypwlxejl = "";
        String lsydpwlb = "";
        String lsydpznydmj = "";
        String lsydpzgdmj = "";
        String lsydpzyjjbntmj = "";

        //土地供应
        String tdgypzwh = "";
        String tdgypwly = "";
        String tdgypzmj = "";
        String tdgypzjg = "";
        String tdgypzrq = "";

        String tdgytdgypwlxejl = "";
        String tdgypwlb = "";
        String tdgypznydmj = "";
        String tdgypzgdmj = "";
        String tdgypzyjjbntmj = "";

        //先行用地
        String xxydpzwh = "";
        String xxydpwly = "";
        String xxydpzmj = "";
        String xxydpzjg = "";
        String xxydpzrq = "";

        String xxydtdgypwlxejl = "";
        String xxydpwlb = "";
        String xxydpznydmj = "";
        String xxydpzgdmj = "";
        String xxydpzyjjbntmj = "";

        //预审
        String yspzwh = "";
        String yspwly = "";
        String yspzmj = "";
        String yspzjg = "";
        String yspzrq = "";

        String ystdgypwlxejl = "";
        String yspwlb = "";
        String yspznydmj = "";
        String yspzgdmj = "";
        String yspzyjjbntmj = "";


        List<Map<String, Object>> list = (List<Map<String, Object>>) parm.get("lists");
        if (list != null && list.size() > 0) {
            for (Map<String, Object> map : list) {
                //更新 信息

                List<Map<String, Object>> hfpwList = (List<Map<String, Object>>) map.get("hfpwlist");
                if (hfpwList != null && hfpwList.size() > 0) {

                    map.put("hf_hfydpw", hfpwList.size());

                    if (hfpwList != null && hfpwList.size() > 0) {
                        int sort = 0;
                        for (Map<String, Object> m : hfpwList) {
                            if (m.get("hf_pwlx").toString().equals("农用地转用")) {
                                nydzypzwh += m.get("hf_pzwh").toString() + ",";
                                nydzypwly += m.get("hf_pwly").toString() + ",";
                                nydzypzmj += m.get("hf_pzmj").toString() + ",";
                                //nydzypzjg+=m.get("hf_pzjg").toString()+",";
                                nydzypzrq += m.get("hf_pzrq").toString() + ",";

                                nydzytdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                nydzypwlb += m.get("hf_pwlb").toString() + ",";
                                nydzypznydmj += m.get("hf_pznydmj").toString() + ",";
                                nydzypzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                nydzypzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("增减挂钩")) {
                                zjggpzwh += m.get("hf_pzwh").toString() + ",";
                                zjggpwly += m.get("hf_pwly").toString() + ",";
                                zjggpzmj += m.get("hf_pzmj").toString() + ",";
                                //zjggpzjg+=m.get("hf_pzjg").toString()+",";
                                zjggpzrq += m.get("hf_pzrq").toString() + ",";

                                zjggtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                zjggpwlb += m.get("hf_pwlb").toString() + ",";
                                zjggpznydmj += m.get("hf_pznydmj").toString() + ",";
                                zjggpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                zjggpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("工矿废弃地")) {
                                gkfqdpzwh += m.get("hf_pzwh").toString() + ",";
                                gkfqdpwly += m.get("hf_pwly").toString() + ",";
                                gkfqdpzmj += m.get("hf_pzmj").toString() + ",";
                                //gkfqdpzjg+=m.get("hf_pzjg").toString()+",";
                                gkfqdpzrq += m.get("hf_pzrq").toString() + ",";

                                gkfqdtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                gkfqdpwlb += m.get("hf_pwlb").toString() + ",";
                                gkfqdpznydmj += m.get("hf_pznydmj").toString() + ",";
                                gkfqdpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                gkfqdpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("不动产权证书")) {

                                bdcqzspzwh += m.get("hf_pzwh").toString() + ",";
                                bdcqzspwly += m.get("hf_pwly").toString() + ",";
                                bdcqzspzmj += m.get("hf_pzmj").toString() + ",";
                                //bdcqzspzjg+=m.get("hf_pzjg").toString()+",";
                                bdcqzspzrq += m.get("hf_pzrq").toString() + ",";

                                bdcqzstdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                bdcqzspwlb += m.get("hf_pwlb").toString() + ",";
                                bdcqzsznydmj += m.get("hf_pznydmj").toString() + ",";
                                bdcqzspzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                bdcqzspzzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("设施农用地")) {
                                ssnydpzwh += m.get("hf_pzwh").toString() + ",";
                                ssnydpwly += m.get("hf_pwly").toString() + ",";
                                ssnydpzmj += m.get("hf_pzmj").toString() + ",";
                                //ssnydpzjg+=m.get("hf_pzjg").toString()+",";
                                ssnydpzrq += m.get("hf_pzrq").toString() + ",";

                                ssnydtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                ssnydpwlb += m.get("hf_pwlb").toString() + ",";
                                ssnydpznydmj += m.get("hf_pznydmj").toString() + ",";
                                ssnydpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                ssnydpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("土地整治验收")) {
                                tdzzyspzwh += m.get("hf_pzwh").toString() + ",";
                                tdzzyspwly += m.get("hf_pwly").toString() + ",";
                                tdzzyspzmj += m.get("hf_pzmj").toString() + ",";
                                //tdzzyspzjg+=m.get("hf_pzjg").toString()+",";
                                tdzzyspzrq += m.get("hf_pzrq").toString() + ",";

                                tdzzystdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                tdzzyspwlb += m.get("hf_pwlb").toString() + ",";
                                tdzzyspznydmj += m.get("hf_pznydmj").toString() + ",";
                                tdzzyspzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                tdzzyspzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";

                            } else if (m.get("hf_pwlx").toString().equals("其他")) {
                                qtpzwh += m.get("hf_pzwh").toString() + ",";
                                qtpwly += m.get("hf_pwly").toString() + ",";
                                qtpzmj += m.get("hf_pzmj").toString() + ",";
                                //qtpzjg+=m.get("hf_pzjg").toString()+",";
                                qtpzrq += m.get("hf_pzrq").toString() + ",";

                                qttdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                qtpwlb += m.get("hf_pwlb").toString() + ",";
                                qtpznydmj += m.get("hf_pznydmj").toString() + ",";
                                qtpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                qtpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("临时用地")) {
                                lsydpzwh += m.get("hf_pzwh").toString() + ",";
                                lsydpwly += m.get("hf_pwly").toString() + ",";
                                lsydpzmj += m.get("hf_pzmj").toString() + ",";
                                //lsydpzjg+=m.get("hf_pzjg").toString()+",";
                                lsydpzrq += m.get("hf_pzrq").toString() + ",";

                                lsydtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                lsydpwlb += m.get("hf_pwlb").toString() + ",";
                                lsydpznydmj += m.get("hf_pznydmj").toString() + ",";
                                lsydpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                lsydpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";

                            } else if (m.get("hf_pwlx").toString().equals("土地供应")) {
                                tdgypzwh += m.get("hf_pzwh").toString() + ",";
                                tdgypwly += m.get("hf_pwly").toString() + ",";
                                tdgypzmj += m.get("hf_pzmj").toString() + ",";
                                //tdgypzjg+=m.get("hf_pzjg").toString()+",";
                                tdgypzrq += m.get("hf_pzrq").toString() + ",";

                                tdgytdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                tdgypwlb += m.get("hf_pwlb").toString() + ",";
                                tdgypznydmj += m.get("hf_pznydmj").toString() + ",";
                                tdgypzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                tdgypzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("先行用地")) {
                                //先行用地
                                xxydpzwh += m.get("hf_pzwh").toString() + ",";
                                xxydpwly += m.get("hf_pwly").toString() + ",";
                                xxydpzmj += m.get("hf_pzmj").toString() + ",";
                                //xxydpzjg+=m.get("hf_pzjg").toString()+",";
                                xxydpzrq += m.get("hf_pzrq").toString() + ",";

                                xxydtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                xxydpwlb += m.get("hf_pwlb").toString() + ",";
                                xxydpznydmj += m.get("hf_pznydmj").toString() + ",";
                                xxydpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                xxydpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("预审")) {
                                yspzwh += m.get("hf_pzwh").toString() + ",";
                                yspwly += m.get("hf_pwly").toString() + ",";
                                yspzmj += m.get("hf_pzmj").toString() + ",";
                                //yspzjg+=m.get("hf_pzjg").toString()+",";
                                yspzrq += m.get("hf_pzrq").toString() + ",";

                                ystdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                yspwlb += m.get("hf_pwlb").toString() + ",";
                                yspznydmj += m.get("hf_pznydmj").toString() + ",";
                                yspzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                yspzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            }
                            m.put("dkbh", map.get("dkbh"));
                            m.put("sort", sort++);
                            m.put("jcbh", jcbh);
                            m.put("pch", pch);
                            m.put("xzqdm", xzqdm);
                        }
                    }
                }
                map.put("pwgs", hfpwList.size());
                map.put("nydzypzwh", nydzypzwh);
                map.put("nydzypwly", nydzypwly);
                map.put("nydzypzmj", nydzypzmj);
                map.put("nydzypzjg", nydzypzjg);
                map.put("nydzypzrq", nydzypzrq);
                map.put("nydzytdgypwlxejl", nydzytdgypwlxejl);
                map.put("nydzypwlb", nydzypwlb);
                map.put("nydzypznydmj", nydzypznydmj);
                map.put("nydzypzgdmj", nydzypzgdmj);
                map.put("nydzypzyjjbntmj", nydzypzyjjbntmj);


                map.put("zjggpzwh", zjggpzwh);
                map.put("zjggpwly", zjggpwly);
                map.put("zjggpzmj", zjggpzmj);
                map.put("zjggpzjg", zjggpzjg);
                map.put("zjggpzrq", zjggpzrq);
                map.put("zjggtdgypwlxejl", zjggtdgypwlxejl);
                map.put("zjggpwlb", zjggpwlb);
                map.put("zjggpznydmj", zjggpznydmj);
                map.put("zjggpzgdmj", zjggpzgdmj);
                map.put("zjggpzyjjbntmj", zjggpzyjjbntmj);


                map.put("gkfqdpzwh", gkfqdpzwh);
                map.put("gkfqdpwly", gkfqdpwly);
                map.put("gkfqdpzmj", gkfqdpzmj);
                map.put("gkfqdpzjg", gkfqdpzjg);
                map.put("gkfqdpzrq", gkfqdpzrq);
                map.put("gkfqdtdgypwlxejl", gkfqdtdgypwlxejl);
                map.put("gkfqdpwlb", gkfqdpwlb);
                map.put("gkfqdpznydmj", gkfqdpznydmj);
                map.put("gkfqdpzgdmj", gkfqdpzgdmj);
                map.put("gkfqdpzyjjbntmj", gkfqdpzyjjbntmj);


                map.put("bdcqzspzwh", bdcqzspzwh);
                map.put("bdcqzspwly", bdcqzspwly);
                map.put("bdcqzspzmj", bdcqzspzmj);
                map.put("bdcqzspzjg", bdcqzspzjg);
                map.put("bdcqzspzrq", bdcqzspzrq);
                map.put("bdcqzstdgypwlxejl", bdcqzstdgypwlxejl);
                map.put("bdcqzspwlb", bdcqzspwlb);
                map.put("bdcqzsznydmj", bdcqzsznydmj);
                map.put("bdcqzspzgdmj", bdcqzspzgdmj);
                map.put("bdcqzszyjjbntmj", bdcqzspzzyjjbntmj);


                map.put("ssnydpzwh", ssnydpzwh);
                map.put("ssnydpwly", ssnydpwly);
                map.put("ssnydpzmj", ssnydpzmj);
                map.put("ssnydpzjg", ssnydpzjg);
                map.put("ssnydpzrq", ssnydpzrq);
                map.put("ssnydtdgypwlxejl", ssnydtdgypwlxejl);
                map.put("ssnydpwlb", ssnydpwlb);
                map.put("ssnydpznydmj", ssnydpznydmj);
                map.put("ssnydpzgdmj", ssnydpzgdmj);
                map.put("ssnydpzyjjbntmj", ssnydpzyjjbntmj);


                map.put("tdzzyspzwh", tdzzyspzwh);
                map.put("tdzzyspwly", tdzzyspwly);
                map.put("tdzzyspzmj", tdzzyspzmj);
                map.put("tdzzyspzjg", tdzzyspzjg);
                map.put("tdzzyspzrq", tdzzyspzrq);
                map.put("tdzzystdgypwlxejl", tdzzystdgypwlxejl);
                map.put("tdzzyspwlb", tdzzyspwlb);
                map.put("tdzzyspznydmj", tdzzyspznydmj);
                map.put("tdzzyspzgdmj", tdzzyspzgdmj);
                map.put("tdzzyspzyjjbntmj", tdzzyspzyjjbntmj);


                map.put("qtpzwh", qtpzwh);
                map.put("qtpwly", qtpwly);
                map.put("qtpzmj", qtpzmj);
                map.put("qtpzjg", qtpzjg);
                map.put("qtpzrq", qtpzrq);
                map.put("qttdgypwlxejl", qttdgypwlxejl);
                map.put("qtpwlb", qtpwlb);
                map.put("qtpznydmj", qtpznydmj);
                map.put("qtpzgdmj", qtpzgdmj);
                map.put("qtpzyjjbntmj", qtpzyjjbntmj);

                map.put("lsydpzwh", lsydpzwh);
                map.put("lsydpwly", lsydpwly);
                map.put("lsydpzmj", lsydpzmj);
                map.put("lsydpzjg", lsydpzjg);
                map.put("lsydpzrq", lsydpzrq);
                map.put("lsydtdgypwlxejl", lsydtdgypwlxejl);
                map.put("lsydpwlb", lsydpwlb);
                map.put("lsydpznydmj", lsydpznydmj);
                map.put("lsydpzgdmj", lsydpzgdmj);
                map.put("lsydpzyjjbntmj", lsydpzyjjbntmj);


                map.put("tdgypzwh", tdgypzwh);
                map.put("tdgypwly", tdgypwly);
                map.put("tdgypzmj", tdgypzmj);
                map.put("tdgypzjg", tdgypzjg);
                map.put("tdgypzrq", tdgypzrq);
                map.put("tdgytdgypwlxejl", tdgytdgypwlxejl);
                map.put("tdgypwlb", tdgypwlb);
                map.put("tdgypznydmj", tdgypznydmj);
                map.put("tdgypzgdmj", tdgypzgdmj);
                map.put("tdgypzyjjbntmj", tdgypzyjjbntmj);


                map.put("xxydpzwh", xxydpzwh);
                map.put("xxydpwly", xxydpwly);
                map.put("xxydpzmj", xxydpzmj);
                map.put("xxydpzjg", xxydpzjg);
                map.put("xxydpzrq", xxydpzrq);
                map.put("xxydtdgypwlxejl", xxydtdgypwlxejl);
                map.put("xxydpwlb", xxydpwlb);
                map.put("xxydpznydmj", xxydpznydmj);
                map.put("xxydpzgdmj", xxydpzgdmj);
                map.put("xxydpzyjjbntmj", xxydpzyjjbntmj);


                map.put("yspzwh", yspzwh);
                map.put("yspwly", yspwly);
                map.put("yspzmj", yspzmj);
                map.put("yspzjg", yspzjg);
                map.put("yspzrq", yspzrq);
                map.put("ystdgypwlxejl", ystdgypwlxejl);
                map.put("yspwlb", yspwlb);
                map.put("yspznydmj", yspznydmj);
                map.put("yspzgdmj", yspzgdmj);
                map.put("yspzyjjbntmj", yspzyjjbntmj);


                map.put("isdel", "0");
                map.put("pch", pch);
                map.put("xzqdm", xzqdm);
                map.put("submitdate", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));

                map.put("dkzt", "5");
                rest = xjtbTbBaseMapper.updateDkxxb(map);
            }
        }
        return rest;
    }

    public String isNull(Object object) {
        String obj = "";
        try {
            obj = object != null ? object.toString() : "";
        } catch (Exception ex) {
            return "";
        }
        return obj;
    }

    @Override
    @Transactional
    public Integer saveDkxxbXj(Map<String, Object> parm) {
        Integer rest = 0;
        String jcbh = parm.get("jcbh").toString();
        String pch = parm.get("pch").toString();
        String xzqdm = parm.get("xzqdm").toString();
        String cffs = parm.get("cffs").toString();
        if(parm.get("cffs").toString().equals("面积拆分"))
        {
            parm.replace("cffs","1");
        }
        else
        {
            parm.replace("cffs","");
        }


        //获取拆分情况 并插入 插入成功 则处理成功
        List<Map<String, Object>> list = (List<Map<String, Object>>) parm.get("lists");
        List<Map<String, Object>> dkbhList = xjtbTbBaseMapper.queryDkbhByJcbh(jcbh);

        if (list != null && list.size() > 0) {
            LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
            if (dkbhList != null && dkbhList.size() == list.size()) {
                for (Map<String, Object> map : list) {
                    String dkbh = map.get("dkbh") + "";
                    if (dkbh.contains(",") && dkbh.indexOf(",") != -1) {
                        String[] arr = dkbh.split(",");
                        for (String s : arr) {
                            Map<String, Object> m = new HashMap();
                            xjtbTbBaseMapper.updateDkxxbXjIsdelState(m);
                        }
                    }

                    map.put("jcbh", jcbh);
                    map.put("dkbh", map.get("dkbh") + "");
                    map.put("tbbh", map.get("dkbh") + "");
                    map.put("isdel", "0");
                    map.put("pch", pch);
                    map.put("xzqdm", xzqdm);
                    map.put("submitdate", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
                    map.put("dkzt", "0");//刚拆分 全部设置为 0 未填报状态

                    map.replace("thdkmj", Double.parseDouble(map.get("thdkmj").toString()));
                    map.replace("thdkgdmj", Double.parseDouble(map.get("thdkgdmj").toString()));
                    map.replace("thdkzjbntmj", Double.parseDouble(map.get("thdkzjbntmj").toString()));
                    map.replace("thnydmj", Double.parseDouble(map.get("thnydmj").toString()));
                    map.replace("thdkstmj", Double.parseDouble(map.get("thdkstmj").toString()));
                    map.replace("thstbhhxmj", Double.parseDouble(map.get("thstbhhxmj").toString()));

                    if (!isNull(map.get("tbdkmj").toString()).equals("")) {
                        map.replace("tbdkmj", Double.parseDouble(isNull(map.get("tbdkmj").toString())));
                    } else {
                        map.replace("tbdkmj", 0);
                    }
                    if (!isNull(map.get("tbdkqzgdmj").toString()).equals("")) {
                        map.replace("tbdkqzgdmj", Double.parseDouble(map.get("tbdkqzgdmj").toString()));
                    } else {
                        map.replace("tbdkqzgdmj", 0);
                    }
                    if (!isNull(map.get("tbdkqzjbntmj").toString()).equals("")) {
                        map.replace("tbdkqzjbntmj", Double.parseDouble(map.get("tbdkqzjbntmj").toString()));
                    } else {
                        map.replace("tbdkqzjbntmj", 0);
                    }
                    if (!isNull(map.get("tbnydmj").toString()).equals("")) {
                        map.replace("tbnydmj", Double.parseDouble(map.get("tbnydmj").toString()));
                    } else {
                        map.replace("tbnydmj", 0);
                    }
                    if (!isNull(map.get("tbdkstmj").toString()).equals("")) {
                        map.replace("tbdkstmj", Double.parseDouble(map.get("tbdkstmj").toString()));
                    } else {
                        map.replace("tbdkstmj", 0);
                    }
                    if (!isNull(map.get("tbdkstbhhxmj").toString()).equals("")) {
                        map.replace("tbdkstbhhxmj", Double.parseDouble(map.get("tbdkstbhhxmj").toString()));
                    } else {
                        map.replace("tbdkstbhhxmj", 0);
                    }
                    map.replace("wkt", map.get("wkt").toString());

                    map.put("tbr", loginUser.getUsername());
                    map.put("tbsj", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
                    rest = xjtbTbBaseMapper.updateDkxxbXjData(map);
                }
            } else {
                xjtbTbBaseMapper.deleteDkxxbXjData(parm);
                for (Map<String, Object> map : list) {
                    String dkbh = map.get("dkbh") + "";
                    if (dkbh.contains(",") && dkbh.indexOf(",") != -1) {
                        String[] arr = dkbh.split(",");
                        for (String s : arr) {
                            Map<String, Object> m = new HashMap();
                            xjtbTbBaseMapper.updateDkxxbXjIsdelState(m);
                        }
                    }

                    map.put("jcbh", jcbh);
                    map.put("dkbh", map.get("dkbh") + "");
                    map.put("tbbh", map.get("dkbh") + "");
                    map.put("isdel", "0");
                    map.put("pch", pch);
                    map.put("xzqdm", xzqdm);
                    map.put("submitdate", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
                    map.put("dkzt", "0");//刚拆分 全部设置为 0 未填报状态

                    map.replace("thdkmj", Double.parseDouble(map.get("thdkmj").toString()));
                    map.replace("thdkgdmj", Double.parseDouble(map.get("thdkgdmj").toString()));
                    map.replace("thdkzjbntmj", Double.parseDouble(map.get("thdkzjbntmj").toString()));
                    map.replace("thnydmj", Double.parseDouble(map.get("thnydmj").toString()));
                    map.replace("thdkstmj", Double.parseDouble(map.get("thdkstmj").toString()));
                    map.replace("thstbhhxmj", Double.parseDouble(map.get("thstbhhxmj").toString()));

                    if (!isNull(map.get("tbdkmj").toString()).equals("")) {
                        map.replace("tbdkmj", Double.parseDouble(isNull(map.get("tbdkmj").toString())));
                    } else {
                        map.replace("tbdkmj", 0);
                    }
                    if (!isNull(map.get("tbdkqzgdmj").toString()).equals("")) {
                        map.replace("tbdkqzgdmj", Double.parseDouble(map.get("tbdkqzgdmj").toString()));
                    } else {
                        map.replace("tbdkqzgdmj", 0);
                    }
                    if (!isNull(map.get("tbdkqzjbntmj").toString()).equals("")) {
                        map.replace("tbdkqzjbntmj", Double.parseDouble(map.get("tbdkqzjbntmj").toString()));
                    } else {
                        map.replace("tbdkqzjbntmj", 0);
                    }
                    if (!isNull(map.get("tbnydmj").toString()).equals("")) {
                        map.replace("tbnydmj", Double.parseDouble(map.get("tbnydmj").toString()));
                    } else {
                        map.replace("tbnydmj", 0);
                    }
                    if (!isNull(map.get("tbdkstmj").toString()).equals("")) {
                        map.replace("tbdkstmj", Double.parseDouble(map.get("tbdkstmj").toString()));
                    } else {
                        map.replace("tbdkstmj", 0);
                    }
                    if (!isNull(map.get("tbdkstbhhxmj").toString()).equals("")) {
                        map.replace("tbdkstbhhxmj", Double.parseDouble(map.get("tbdkstbhhxmj").toString()));
                    } else {
                        map.replace("tbdkstbhhxmj", 0);
                    }
                    map.replace("wkt", map.get("wkt").toString());
                    map.put("uid", UUID.randomUUID().toString().replace("-", ""));

                    map.put("tbr", loginUser.getUsername());
                    map.put("tbsj", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
                    rest = xjtbTbBaseMapper.addDkxxbXjData11(map);
                }
            }
            rest = xjtbTbBaseMapper.updateTbxxbXjSaveState2(parm); //iscl 设置为 1  更新方式
        }
        return rest;
    }

    @Override
    public Integer saveDkxxbXjByDk(Map<String, Object> parm) {
        Integer rest = 0;
        String jcbh = parm.get("jcbh").toString();
        String pch = parm.get("pch").toString();
        String xzqdm = parm.get("xzqdm").toString();
        String olddkbh = parm.get("olddkbh").toString();

        String pwgs = "";
        //农专用
        String nydzypzwh = "";
        String nydzypwly = "";
        String nydzypzmj = "";
        String nydzypzjg = "";
        String nydzypzrq = "";

        String nydzytdgypwlxejl = "";
        String nydzypwlb = "";
        String nydzypznydmj = "";
        String nydzypzgdmj = "";
        String nydzypzyjjbntmj = "";

        //增减挂钩
        String zjggpzwh = "";
        String zjggpwly = "";
        String zjggpzmj = "";
        String zjggpzjg = "";
        String zjggpzrq = "";

        String zjggtdgypwlxejl = "";
        String zjggpwlb = "";
        String zjggpznydmj = "";
        String zjggpzgdmj = "";
        String zjggpzyjjbntmj = "";

        //工矿废弃地
        String gkfqdpzwh = "";
        String gkfqdpwly = "";
        String gkfqdpzmj = "";
        String gkfqdpzjg = "";
        String gkfqdpzrq = "";

        String gkfqdtdgypwlxejl = "";
        String gkfqdpwlb = "";
        String gkfqdpznydmj = "";
        String gkfqdpzgdmj = "";
        String gkfqdpzyjjbntmj = "";

        //不动产权证书
        String bdcqzspzwh = "";
        String bdcqzspwly = "";
        String bdcqzspzmj = "";
        String bdcqzspzjg = "";
        String bdcqzspzrq = "";

        String bdcqzstdgypwlxejl = "";
        String bdcqzspwlb = "";
        String bdcqzszpznydmj = "";
        String bdcqzspzgdmj = "";
        String bdcqzszyjjbntmj = "";

        //设施农用地
        String ssnydpzwh = "";
        String ssnydpwly = "";
        String ssnydpzmj = "";
        String ssnydpzjg = "";
        String ssnydpzrq = "";


        String ssnydtdgypwlxejl = "";
        String ssnydpwlb = "";
        String ssnydpznydmj = "";
        String ssnydpzgdmj = "";
        String ssnydpzyjjbntmj = "";

        //土地整治验收
        String tdzzyspzwh = "";
        String tdzzyspwly = "";
        String tdzzyspzmj = "";
        String tdzzyspzjg = "";
        String tdzzyspzrq = "";

        String tdzzystdgypwlxejl = "";
        String tdzzyspwlb = "";
        String tdzzyspznydmj = "";
        String tdzzyspzgdmj = "";
        String tdzzyspzyjjbntmj = "";

        //其他
        String qtpzwh = "";
        String qtpwly = "";
        String qtpzmj = "";
        String qtpzjg = "";
        String qtpzrq = "";

        String qttdgypwlxejl = "";
        String qtpwlb = "";
        String qtpznydmj = "";
        String qtpzgdmj = "";
        String qtpzyjjbntmj = "";

        //临时用地
        String lsydpzwh = "";
        String lsydpwly = "";
        String lsydpzmj = "";
        String lsydpzjg = "";
        String lsydpzrq = "";

        String lsydtdgypwlxejl = "";
        String lsydpwlb = "";
        String lsydpznydmj = "";
        String lsydpzgdmj = "";
        String lsydpzyjjbntmj = "";

        //土地供应
        String tdgypzwh = "";
        String tdgypwly = "";
        String tdgypzmj = "";
        String tdgypzjg = "";
        String tdgypzrq = "";

        String tdgytdgypwlxejl = "";
        String tdgypwlb = "";
        String tdgypznydmj = "";
        String tdgypzgdmj = "";
        String tdgypzyjjbntmj = "";

        //先行用地
        String xxydpzwh = "";
        String xxydpwly = "";
        String xxydpzmj = "";
        String xxydpzjg = "";
        String xxydpzrq = "";

        String xxydtdgypwlxejl = "";
        String xxydpwlb = "";
        String xxydpznydmj = "";
        String xxydpzgdmj = "";
        String xxydpzyjjbntmj = "";

        //预审
        String yspzwh = "";
        String yspwly = "";
        String yspzmj = "";
        String yspzjg = "";
        String yspzrq = "";

        String ystdgypwlxejl = "";
        String yspwlb = "";
        String yspznydmj = "";
        String yspzgdmj = "";
        String yspzyjjbntmj = "";

        List<Map<String, Object>> list = (List<Map<String, Object>>) parm.get("lists");
        if (list != null && list.size() > 0) {
            for (Map<String, Object> map : list) {
                //更新 信息

                List<Map<String, Object>> hfpwList = (List<Map<String, Object>>) map.get("hfpwlist");
                if (hfpwList != null && hfpwList.size() > 0) {

                    map.put("hf_hfydpw", hfpwList.size());

                    if (hfpwList != null && hfpwList.size() > 0) {
                        int sort = 0;
                        xjtbTbBaseMapper.deleteDkxxbxjPw(map);
                        for (Map<String, Object> m : hfpwList) {
                            m.put("sort", sort++);
                            m.put("dkbh", map.get("dkbh"));
                            m.put("tbbh", map.get("dkbh"));
                            m.put("jcbh", jcbh);
                            m.put("pch", pch);
                            m.put("xzqdm", xzqdm);

                            xjtbTbBaseMapper.saveDkxxbxjPw(m);
                            if (m.get("hf_pwlx").toString().equals("农用地转用")) {
                                nydzypzwh += m.get("hf_pzwh").toString() + ",";
                                nydzypwly += m.get("hf_pwly").toString() + ",";
                                nydzypzmj += m.get("hf_pzmj").toString() + ",";
                                //nydzypzjg+=m.get("hf_pzjg").toString()+",";
                                nydzypzrq += m.get("hf_pzrq").toString() + ",";

                                nydzytdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                nydzypwlb += m.get("hf_pwlb").toString() + ",";
                                nydzypznydmj += m.get("hf_pznydmj").toString() + ",";
                                nydzypzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                nydzypzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("增减挂钩")) {
                                zjggpzwh += m.get("hf_pzwh").toString() + ",";
                                zjggpwly += m.get("hf_pwly").toString() + ",";
                                zjggpzmj += m.get("hf_pzmj").toString() + ",";
                                //zjggpzjg+=m.get("hf_pzjg").toString()+",";
                                zjggpzrq += m.get("hf_pzrq").toString() + ",";

                                zjggtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                zjggpwlb += m.get("hf_pwlb").toString() + ",";
                                zjggpznydmj += m.get("hf_pznydmj").toString() + ",";
                                zjggpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                zjggpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("工矿废弃地")) {
                                gkfqdpzwh += m.get("hf_pzwh").toString() + ",";
                                gkfqdpwly += m.get("hf_pwly").toString() + ",";
                                gkfqdpzmj += m.get("hf_pzmj").toString() + ",";
                                //gkfqdpzjg+=m.get("hf_pzjg").toString()+",";
                                gkfqdpzrq += m.get("hf_pzrq").toString() + ",";

                                gkfqdtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                gkfqdpwlb += m.get("hf_pwlb").toString() + ",";
                                gkfqdpznydmj += m.get("hf_pznydmj").toString() + ",";
                                gkfqdpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                gkfqdpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("不动产权证书")) {

                                bdcqzspzwh += m.get("hf_pzwh").toString() + ",";
                                bdcqzspwly += m.get("hf_pwly").toString() + ",";
                                bdcqzspzmj += m.get("hf_pzmj").toString() + ",";
                                //bdcqzspzjg+=m.get("hf_pzjg").toString()+",";
                                bdcqzspzrq += m.get("hf_pzrq").toString() + ",";

                                bdcqzstdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                bdcqzspwlb += m.get("hf_pwlb").toString() + ",";
                                bdcqzszpznydmj += m.get("hf_pznydmj").toString() + ",";
                                bdcqzspzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                bdcqzszyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("设施农用地")) {
                                ssnydpzwh += m.get("hf_pzwh").toString() + ",";
                                ssnydpwly += m.get("hf_pwly").toString() + ",";
                                ssnydpzmj += m.get("hf_pzmj").toString() + ",";
                                //ssnydpzjg+=m.get("hf_pzjg").toString()+",";
                                ssnydpzrq += m.get("hf_pzrq").toString() + ",";

                                ssnydtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                ssnydpwlb += m.get("hf_pwlb").toString() + ",";
                                ssnydpznydmj += m.get("hf_pznydmj").toString() + ",";
                                ssnydpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                ssnydpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("土地整治验收")) {
                                tdzzyspzwh += m.get("hf_pzwh").toString() + ",";
                                tdzzyspwly += m.get("hf_pwly").toString() + ",";
                                tdzzyspzmj += m.get("hf_pzmj").toString() + ",";
                                //tdzzyspzjg+=m.get("hf_pzjg").toString()+",";
                                tdzzyspzrq += m.get("hf_pzrq").toString() + ",";

                                tdzzystdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                tdzzyspwlb += m.get("hf_pwlb").toString() + ",";
                                tdzzyspznydmj += m.get("hf_pznydmj").toString() + ",";
                                tdzzyspzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                tdzzyspzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";

                            } else if (m.get("hf_pwlx").toString().equals("其他")) {
                                qtpzwh += m.get("hf_pzwh").toString() + ",";
                                qtpwly += m.get("hf_pwly").toString() + ",";
                                qtpzmj += m.get("hf_pzmj").toString() + ",";
                                //qtpzjg+=m.get("hf_pzjg").toString()+",";
                                qtpzrq += m.get("hf_pzrq").toString() + ",";

                                qttdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                qtpwlb += m.get("hf_pwlb").toString() + ",";
                                qtpznydmj += m.get("hf_pznydmj").toString() + ",";
                                qtpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                qtpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("临时用地")) {
                                lsydpzwh += m.get("hf_pzwh").toString() + ",";
                                lsydpwly += m.get("hf_pwly").toString() + ",";
                                lsydpzmj += m.get("hf_pzmj").toString() + ",";
                                //lsydpzjg+=m.get("hf_pzjg").toString()+",";
                                lsydpzrq += m.get("hf_pzrq").toString() + ",";

                                lsydtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                lsydpwlb += m.get("hf_pwlb").toString() + ",";
                                lsydpznydmj += m.get("hf_pznydmj").toString() + ",";
                                lsydpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                lsydpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";

                            } else if (m.get("hf_pwlx").toString().equals("土地供应")) {
                                tdgypzwh += m.get("hf_pzwh").toString() + ",";
                                tdgypwly += m.get("hf_pwly").toString() + ",";
                                tdgypzmj += m.get("hf_pzmj").toString() + ",";
                                //tdgypzjg=m.get("hf_pzjg").toString()+",";
                                tdgypzrq += m.get("hf_pzrq").toString() + ",";

                                tdgytdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                tdgypwlb += m.get("hf_pwlb").toString() + ",";
                                tdgypznydmj += m.get("hf_pznydmj").toString() + ",";
                                tdgypzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                tdgypzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("先行用地")) {
                                //先行用地
                                xxydpzwh += m.get("hf_pzwh").toString() + ",";
                                xxydpwly += m.get("hf_pwly").toString() + ",";
                                xxydpzmj += m.get("hf_pzmj").toString() + ",";
                                //xxydpzjg+=m.get("hf_pzjg").toString()+",";
                                xxydpzrq += m.get("hf_pzrq").toString() + ",";

                                xxydtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                xxydpwlb += m.get("hf_pwlb").toString() + ",";
                                xxydpznydmj += m.get("hf_pznydmj").toString() + ",";
                                xxydpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                xxydpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("预审")) {
                                yspzwh += m.get("hf_pzwh").toString() + ",";
                                yspwly += m.get("hf_pwly").toString() + ",";
                                yspzmj += m.get("hf_pzmj").toString() + ",";
                                //yspzjg=m.get("hf_pzjg").toString()+",";
                                yspzrq += m.get("hf_pzrq").toString() + ",";

                                ystdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                yspwlb += m.get("hf_pwlb").toString() + ",";
                                yspznydmj += m.get("hf_pznydmj").toString() + ",";
                                yspzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                yspzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            }
                        }
                    }
                    map.put("pwgs", hfpwList.size());
                } else {
                    map.put("pwgs", 0);
                }

                map.put("nydzypzwh", nydzypzwh);
                map.put("nydzypwly", nydzypwly);
                map.put("nydzypzmj", nydzypzmj);
                map.put("nydzypzjg", nydzypzjg);
                map.put("nydzypzrq", nydzypzrq);
                map.put("nydzytdgypwlxejl", nydzytdgypwlxejl);
                map.put("nydzypwlb", nydzypwlb);
                map.put("nydzypznydmj", nydzypznydmj);
                map.put("nydzypzgdmj", nydzypzgdmj);
                map.put("nydzypzyjjbntmj", nydzypzyjjbntmj);


                map.put("zjggpzwh", zjggpzwh);
                map.put("zjggpwly", zjggpwly);
                map.put("zjggpzmj", zjggpzmj);
                map.put("zjggpzjg", zjggpzjg);
                map.put("zjggpzrq", zjggpzrq);
                map.put("zjggtdgypwlxejl", zjggtdgypwlxejl);
                map.put("zjggpwlb", zjggpwlb);
                map.put("zjggpznydmj", zjggpznydmj);
                map.put("zjggpzgdmj", zjggpzgdmj);
                map.put("zjggpzyjjbntmj", zjggpzyjjbntmj);

                map.put("gkfqdpzwh", gkfqdpzwh);
                map.put("gkfqdpwly", gkfqdpwly);
                map.put("gkfqdpzmj", gkfqdpzmj);
                map.put("gkfqdpzjg", gkfqdpzjg);
                map.put("gkfqdpzrq", gkfqdpzrq);
                map.put("gkfqdtdgypwlxejl", gkfqdtdgypwlxejl);
                map.put("gkfqdpwlb", gkfqdpwlb);
                map.put("gkfqdpznydmj", gkfqdpznydmj);
                map.put("gkfqdpzgdmj", gkfqdpzgdmj);
                map.put("gkfqdpzyjjbntmj", gkfqdpzyjjbntmj);
                if ("null".equals(map.get("qtjtqx")+"")) {
                    map.put("qtsjytyjmc","");
                } else {
                    map.put("qtsjytyjmc",map.get("qtjtqx").toString());
                };

                map.put("bdcqzspzwh", bdcqzspzwh);
                map.put("bdcqzspwly", bdcqzspwly);
                map.put("bdcqzspzmj", bdcqzspzmj);
                map.put("bdcqzspzjg", bdcqzspzjg);
                map.put("bdcqzspzrq", bdcqzspzrq);
                map.put("bdcqzstdgypwlxejl", bdcqzstdgypwlxejl);
                map.put("bdcqzspwlb", bdcqzspwlb);
                map.put("bdcqzszpznydmj", bdcqzszpznydmj);
                map.put("bdcqzspzgdmj", bdcqzspzgdmj);
                map.put("bdcqzszyjjbntmj", bdcqzszyjjbntmj);


                map.put("ssnydpzwh", ssnydpzwh);
                map.put("ssnydpwly", ssnydpwly);
                map.put("ssnydpzmj", ssnydpzmj);
                map.put("ssnydpzjg", ssnydpzjg);
                map.put("ssnydpzrq", ssnydpzrq);
                map.put("ssnydtdgypwlxejl", ssnydtdgypwlxejl);
                map.put("ssnydpwlb", ssnydpwlb);
                map.put("ssnydpznydmj", ssnydpznydmj);
                map.put("ssnydpzgdmj", ssnydpzgdmj);
                map.put("ssnydpzyjjbntmj", ssnydpzyjjbntmj);


                map.put("tdzzyspzwh", tdzzyspzwh);
                map.put("tdzzyspwly", tdzzyspwly);
                map.put("tdzzyspzmj", tdzzyspzmj);
                map.put("tdzzyspzjg", tdzzyspzjg);
                map.put("tdzzyspzrq", tdzzyspzrq);
                map.put("tdzzystdgypwlxejl", tdzzystdgypwlxejl);
                map.put("tdzzyspwlb", tdzzyspwlb);
                map.put("tdzzyspznydmj", tdzzyspznydmj);
                map.put("tdzzyspzgdmj", tdzzyspzgdmj);
                map.put("tdzzyspzyjjbntmj", tdzzyspzyjjbntmj);


                map.put("qtpzwh", qtpzwh);
                map.put("qtpwly", qtpwly);
                map.put("qtpzmj", qtpzmj);
                map.put("qtpzjg", qtpzjg);
                map.put("qtpzrq", qtpzrq);
                map.put("qttdgypwlxejl", qttdgypwlxejl);
                map.put("qtpwlb", qtpwlb);
                map.put("qtpznydmj", qtpznydmj);
                map.put("qtpzgdmj", qtpzgdmj);
                map.put("qtpzyjjbntmj", qtpzyjjbntmj);

                map.put("lsydpzwh", lsydpzwh);
                map.put("lsydpwly", lsydpwly);
                map.put("lsydpzmj", lsydpzmj);
                map.put("lsydpzjg", lsydpzjg);
                map.put("lsydpzrq", lsydpzrq);
                map.put("lsydtdgypwlxejl", lsydtdgypwlxejl);
                map.put("lsydpwlb", lsydpwlb);
                map.put("lsydpznydmj", lsydpznydmj);
                map.put("lsydpzgdmj", lsydpzgdmj);
                map.put("lsydpzyjjbntmj", lsydpzyjjbntmj);


                map.put("tdgypzwh", tdgypzwh);
                map.put("tdgypwly", tdgypwly);
                map.put("tdgypzmj", tdgypzmj);
                map.put("tdgypzjg", tdgypzjg);
                map.put("tdgypzrq", tdgypzrq);
                map.put("tdgytdgypwlxejl", tdgytdgypwlxejl);
                map.put("tdgypwlb", tdgypwlb);
                map.put("tdgypznydmj", tdgypznydmj);
                map.put("tdgypzgdmj", tdgypzgdmj);
                map.put("tdgypzyjjbntmj", tdgypzyjjbntmj);


                map.put("xxydpzwh", xxydpzwh);
                map.put("xxydpwly", xxydpwly);
                map.put("xxydpzmj", xxydpzmj);
                map.put("xxydpzjg", xxydpzjg);
                map.put("xxydpzrq", xxydpzrq);
                map.put("xxydtdgypwlxejl", xxydtdgypwlxejl);
                map.put("xxydpwlb", xxydpwlb);
                map.put("xxydpznydmj", xxydpznydmj);
                map.put("xxydpzgdmj", xxydpzgdmj);
                map.put("xxydpzyjjbntmj", xxydpzyjjbntmj);


                map.put("yspzwh", yspzwh);
                map.put("yspwly", yspwly);
                map.put("yspzmj", yspzmj);
                map.put("yspzjg", yspzjg);
                map.put("yspzrq", yspzrq);
                map.put("ystdgypwlxejl", ystdgypwlxejl);
                map.put("yspwlb", yspwlb);
                map.put("yspznydmj", yspznydmj);
                map.put("yspzgdmj", yspzgdmj);
                map.put("yspzyjjbntmj", yspzyjjbntmj);


                map.put("isdel", "0");
                map.put("pch", pch);
                map.put("tbbh", map.get("dkbh").toString());
                map.put("xzqdm", xzqdm);
                map.put("submitdate", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));



                map.put("dkzt", "1");
                Map<String, Object> map1 = new HashMap<>();
                if (map.get("dkbh").toString().equals(olddkbh)) {
                    rest = xjtbTbBaseMapper.updateDkxxb(map);
                }  //前期已经有了  直接更新
                else  //前期没有 则先删除 再合并
                {
                    String[] tbbhs = map.get("dkbh").toString().split(",");
                    if (tbbhs.length > 0) {
                        for (int k = 0; k < tbbhs.length; k++) {
                            String dkbh = tbbhs[k].toString();

                            map1.put("dkbh", dkbh);
                            int mm = xjtbTbBaseMapper.deleteDkxxbXjByDkbh(map1);//全部删除
                        }
                    }
                    map1.put("dkbh", map.get("dkbh").toString());
                    int mm = xjtbTbBaseMapper.deleteDkxxbXjByDkbh(map1);//全部删除
                    map.put("uid", UUID.randomUUID().toString().replace("-", ""));

                    rest = xjtbTbBaseMapper.addDkxxbXjData12(map);
                }

//                rest = xjtbTbBaseMapper.updateDkxxb(map);
            }
        }
        return rest;
    }

    @Override
    public Integer saveWtgDkxxbXj(Map<String, Object> parm) {
        Integer rest = 0;
        String jcbh = parm.get("jcbh").toString();
        String pch = parm.get("pch").toString();
        String xzqdm = parm.get("xzqdm").toString();
        String olddkbh = parm.get("olddkbh").toString();

        String pwgs = "";
        //农专用
        String nydzypzwh = "";
        String nydzypwly = "";
        String nydzypzmj = "";
        String nydzypzjg = "";
        String nydzypzrq = "";

        String nydzytdgypwlxejl = "";
        String nydzypwlb = "";
        String nydzypznydmj = "";
        String nydzypzgdmj = "";
        String nydzypzyjjbntmj = "";

        //增减挂钩
        String zjggpzwh = "";
        String zjggpwly = "";
        String zjggpzmj = "";
        String zjggpzjg = "";
        String zjggpzrq = "";

        String zjggtdgypwlxejl = "";
        String zjggpwlb = "";
        String zjggpznydmj = "";
        String zjggpzgdmj = "";
        String zjggpzyjjbntmj = "";

        //工矿废弃地
        String gkfqdpzwh = "";
        String gkfqdpwly = "";
        String gkfqdpzmj = "";
        String gkfqdpzjg = "";
        String gkfqdpzrq = "";

        String gkfqdtdgypwlxejl = "";
        String gkfqdpwlb = "";
        String gkfqdpznydmj = "";
        String gkfqdpzgdmj = "";
        String gkfqdpzyjjbntmj = "";

        //不动产权证书
        String bdcqzspzwh = "";
        String bdcqzspwly = "";
        String bdcqzspzmj = "";
        String bdcqzspzjg = "";
        String bdcqzspzrq = "";

        String bdcqzstdgypwlxejl = "";
        String bdcqzspwlb = "";
        String bdcqzszpznydmj = "";
        String bdcqzspzgdmj = "";
        String bdcqzspzyjjbntmj = "";

        //设施农用地
        String ssnydpzwh = "";
        String ssnydpwly = "";
        String ssnydpzmj = "";
        String ssnydpzjg = "";
        String ssnydpzrq = "";


        String ssnydtdgypwlxejl = "";
        String ssnydpwlb = "";
        String ssnydpznydmj = "";
        String ssnydpzgdmj = "";
        String ssnydpzyjjbntmj = "";

        //土地整治验收
        String tdzzyspzwh = "";
        String tdzzyspwly = "";
        String tdzzyspzmj = "";
        String tdzzyspzjg = "";
        String tdzzyspzrq = "";

        String tdzzystdgypwlxejl = "";
        String tdzzyspwlb = "";
        String tdzzyspznydmj = "";
        String tdzzyspzgdmj = "";
        String tdzzyspzyjjbntmj = "";

        //其他
        String qtpzwh = "";
        String qtpwly = "";
        String qtpzmj = "";
        String qtpzjg = "";
        String qtpzrq = "";

        String qttdgypwlxejl = "";
        String qtpwlb = "";
        String qtpznydmj = "";
        String qtpzgdmj = "";
        String qtpzyjjbntmj = "";

        //临时用地
        String lsydpzwh = "";
        String lsydpwly = "";
        String lsydpzmj = "";
        String lsydpzjg = "";
        String lsydpzrq = "";

        String lsydtdgypwlxejl = "";
        String lsydpwlb = "";
        String lsydpznydmj = "";
        String lsydpzgdmj = "";
        String lsydpzyjjbntmj = "";

        //土地供应
        String tdgypzwh = "";
        String tdgypwly = "";
        String tdgypzmj = "";
        String tdgypzjg = "";
        String tdgypzrq = "";

        String tdgytdgypwlxejl = "";
        String tdgypwlb = "";
        String tdgypznydmj = "";
        String tdgypzgdmj = "";
        String tdgypzyjjbntmj = "";

        //先行用地
        String xxydpzwh = "";
        String xxydpwly = "";
        String xxydpzmj = "";
        String xxydpzjg = "";
        String xxydpzrq = "";

        String xxydtdgypwlxejl = "";
        String xxydpwlb = "";
        String xxydpznydmj = "";
        String xxydpzgdmj = "";
        String xxydpzyjjbntmj = "";

        //预审
        String yspzwh = "";
        String yspwly = "";
        String yspzmj = "";
        String yspzjg = "";
        String yspzrq = "";

        String ystdgypwlxejl = "";
        String yspwlb = "";
        String yspznydmj = "";
        String yspzgdmj = "";
        String yspzyjjbntmj = "";

        List<Map<String, Object>> list = (List<Map<String, Object>>) parm.get("lists");
        if (list != null && list.size() > 0) {
            for (Map<String, Object> map : list) {
                //更新 信息

                List<Map<String, Object>> hfpwList = (List<Map<String, Object>>) map.get("hfpwlist");
                if (hfpwList != null && hfpwList.size() > 0) {

                    map.put("hf_hfydpw", hfpwList.size());

                    if (hfpwList != null && hfpwList.size() > 0) {
                        int sort = 0;
                        for (Map<String, Object> m : hfpwList) {
                            if (m.get("hf_pwlx").toString().equals("农用地转用")) {
                                nydzypzwh += m.get("hf_pzwh").toString() + ",";
                                nydzypwly += m.get("hf_pwly").toString() + ",";
                                nydzypzmj += m.get("hf_pzmj").toString() + ",";
                                //nydzypzjg+=m.get("hf_pzjg").toString()+",";
                                nydzypzrq += m.get("hf_pzrq").toString() + ",";

                                nydzytdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                nydzypwlb += m.get("hf_pwlb").toString() + ",";
                                nydzypznydmj += m.get("hf_pznydmj").toString() + ",";
                                nydzypzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                nydzypzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("增减挂钩")) {
                                zjggpzwh += m.get("hf_pzwh").toString() + ",";
                                zjggpwly += m.get("hf_pwly").toString() + ",";
                                zjggpzmj += m.get("hf_pzmj").toString() + ",";
                                //zjggpzjg+=m.get("hf_pzjg").toString()+",";
                                zjggpzrq += m.get("hf_pzrq").toString() + ",";

                                zjggtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                zjggpwlb += m.get("hf_pwlb").toString() + ",";
                                zjggpznydmj += m.get("hf_pznydmj").toString() + ",";
                                zjggpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                zjggpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("工矿废弃地")) {
                                gkfqdpzwh += m.get("hf_pzwh").toString() + ",";
                                gkfqdpwly += m.get("hf_pwly").toString() + ",";
                                gkfqdpzmj += m.get("hf_pzmj").toString() + ",";
                                //gkfqdpzjg+=m.get("hf_pzjg").toString()+",";
                                gkfqdpzrq += m.get("hf_pzrq").toString() + ",";

                                gkfqdtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                gkfqdpwlb += m.get("hf_pwlb").toString() + ",";
                                gkfqdpznydmj += m.get("hf_pznydmj").toString() + ",";
                                gkfqdpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                gkfqdpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("不动产权证书")) {

                                bdcqzspzwh += m.get("hf_pzwh").toString() + ",";
                                bdcqzspwly += m.get("hf_pwly").toString() + ",";
                                bdcqzspzmj += m.get("hf_pzmj").toString() + ",";
                                //bdcqzspzjg+=m.get("hf_pzjg").toString()+",";
                                bdcqzspzrq += m.get("hf_pzrq").toString() + ",";

                                bdcqzstdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                bdcqzspwlb += m.get("hf_pwlb").toString() + ",";
                                bdcqzszpznydmj += m.get("hf_pznydmj").toString() + ",";
                                bdcqzspzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                bdcqzspzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("设施农用地")) {
                                ssnydpzwh += m.get("hf_pzwh").toString() + ",";
                                ssnydpwly += m.get("hf_pwly").toString() + ",";
                                ssnydpzmj += m.get("hf_pzmj").toString() + ",";
                                //ssnydpzjg+=m.get("hf_pzjg").toString()+",";
                                ssnydpzrq += m.get("hf_pzrq").toString() + ",";

                                ssnydtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                ssnydpwlb += m.get("hf_pwlb").toString() + ",";
                                ssnydpznydmj += m.get("hf_pznydmj").toString() + ",";
                                ssnydpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                ssnydpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("土地整治验收")) {
                                tdzzyspzwh += m.get("hf_pzwh").toString() + ",";
                                tdzzyspwly += m.get("hf_pwly").toString() + ",";
                                tdzzyspzmj += m.get("hf_pzmj").toString() + ",";
                                //tdzzyspzjg+=m.get("hf_pzjg").toString()+",";
                                tdzzyspzrq += m.get("hf_pzrq").toString() + ",";

                                tdzzystdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                tdzzyspwlb += m.get("hf_pwlb").toString() + ",";
                                tdzzyspznydmj += m.get("hf_pznydmj").toString() + ",";
                                tdzzyspzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                tdzzyspzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";

                            } else if (m.get("hf_pwlx").toString().equals("其他")) {
                                qtpzwh += m.get("hf_pzwh").toString() + ",";
                                qtpwly += m.get("hf_pwly").toString() + ",";
                                qtpzmj += m.get("hf_pzmj").toString() + ",";
                                //qtpzjg+=m.get("hf_pzjg").toString()+",";
                                qtpzrq += m.get("hf_pzrq").toString() + ",";

                                qttdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                qtpwlb += m.get("hf_pwlb").toString() + ",";
                                qtpznydmj += m.get("hf_pznydmj").toString() + ",";
                                qtpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                qtpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("临时用地")) {
                                lsydpzwh += m.get("hf_pzwh").toString() + ",";
                                lsydpwly += m.get("hf_pwly").toString() + ",";
                                lsydpzmj += m.get("hf_pzmj").toString() + ",";
                                //lsydpzjg+=m.get("hf_pzjg").toString()+",";
                                lsydpzrq += m.get("hf_pzrq").toString() + ",";

                                lsydtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                lsydpwlb += m.get("hf_pwlb").toString() + ",";
                                lsydpznydmj += m.get("hf_pznydmj").toString() + ",";
                                lsydpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                lsydpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";

                            } else if (m.get("hf_pwlx").toString().equals("土地供应")) {
                                tdgypzwh += m.get("hf_pzwh").toString() + ",";
                                tdgypwly += m.get("hf_pwly").toString() + ",";
                                tdgypzmj += m.get("hf_pzmj").toString() + ",";
                                //tdgypzjg+=m.get("hf_pzjg").toString()+",";
                                tdgypzrq += m.get("hf_pzrq").toString() + ",";

                                tdgytdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                tdgypwlb += m.get("hf_pwlb").toString() + ",";
                                tdgypznydmj += m.get("hf_pznydmj").toString() + ",";
                                tdgypzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                tdgypzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("先行用地")) {
                                //先行用地
                                xxydpzwh += m.get("hf_pzwh").toString() + ",";
                                xxydpwly += m.get("hf_pwly").toString() + ",";
                                xxydpzmj += m.get("hf_pzmj").toString() + ",";
                                //xxydpzjg+=m.get("hf_pzjg").toString()+",";
                                xxydpzrq += m.get("hf_pzrq").toString() + ",";

                                xxydtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                xxydpwlb += m.get("hf_pwlb").toString() + ",";
                                xxydpznydmj += m.get("hf_pznydmj").toString() + ",";
                                xxydpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                xxydpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("预审")) {
                                yspzwh += m.get("hf_pzwh").toString() + ",";
                                yspwly += m.get("hf_pwly").toString() + ",";
                                yspzmj += m.get("hf_pzmj").toString() + ",";
                                //yspzjg+=m.get("hf_pzjg").toString()+",";
                                yspzrq += m.get("hf_pzrq").toString() + ",";

                                ystdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                yspwlb += m.get("hf_pwlb").toString() + ",";
                                yspznydmj += m.get("hf_pznydmj").toString() + ",";
                                yspzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                yspzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            }
                            m.put("dkbh", map.get("dkbh"));
                            m.put("sort", sort++);
                            m.put("jcbh", jcbh);
                            m.put("pch", pch);
                            m.put("xzqdm", xzqdm);
                        }
                    }
                }
                map.put("pwgs", hfpwList.size());
                map.put("nydzypzwh", nydzypzwh);
                map.put("nydzypwly", nydzypwly);
                map.put("nydzypzmj", nydzypzmj);
                map.put("nydzypzjg", nydzypzjg);
                map.put("nydzypzrq", nydzypzrq);
                map.put("nydzytdgypwlxejl", nydzytdgypwlxejl);
                map.put("nydzypwlb", nydzypwlb);
                map.put("nydzypznydmj", nydzypznydmj);
                map.put("nydzypzgdmj", nydzypzgdmj);
                map.put("nydzypzyjjbntmj", nydzypzyjjbntmj);


                map.put("zjggpzwh", zjggpzwh);
                map.put("zjggpwly", zjggpwly);
                map.put("zjggpzmj", zjggpzmj);
                map.put("zjggpzjg", zjggpzjg);
                map.put("zjggpzrq", zjggpzrq);
                map.put("zjggtdgypwlxejl", zjggtdgypwlxejl);
                map.put("zjggpwlb", zjggpwlb);
                map.put("zjggpznydmj", zjggpznydmj);
                map.put("zjggpzgdmj", zjggpzgdmj);
                map.put("zjggpzyjjbntmj", zjggpzyjjbntmj);

                map.put("gkfqdpzwh", gkfqdpzwh);
                map.put("gkfqdpwly", gkfqdpwly);
                map.put("gkfqdpzmj", gkfqdpzmj);
                map.put("gkfqdpzjg", gkfqdpzjg);
                map.put("gkfqdpzrq", gkfqdpzrq);
                map.put("gkfqdtdgypwlxejl", gkfqdtdgypwlxejl);
                map.put("gkfqdpwlb", gkfqdpwlb);
                map.put("gkfqdpznydmj", gkfqdpznydmj);
                map.put("gkfqdpzgdmj", gkfqdpzgdmj);
                map.put("gkfqdpzyjjbntmj", gkfqdpzyjjbntmj);


                map.put("bdcqzspzwh", bdcqzspzwh);
                map.put("bdcqzspwly", bdcqzspwly);
                map.put("bdcqzspzmj", bdcqzspzmj);
                map.put("bdcqzspzjg", bdcqzspzjg);
                map.put("bdcqzspzrq", bdcqzspzrq);
                map.put("bdcqzstdgypwlxejl", bdcqzstdgypwlxejl);
                map.put("bdcqzspwlb", bdcqzspwlb);
                map.put("bdcqzszpznydmj", bdcqzszpznydmj);
                map.put("bdcqzspzgdmj", bdcqzspzgdmj);
                map.put("bdcqzszyjjbntmj", bdcqzspzyjjbntmj);


                map.put("ssnydpzwh", ssnydpzwh);
                map.put("ssnydpwly", ssnydpwly);
                map.put("ssnydpzmj", ssnydpzmj);
                map.put("ssnydpzjg", ssnydpzjg);
                map.put("ssnydpzrq", ssnydpzrq);
                map.put("ssnydtdgypwlxejl", ssnydtdgypwlxejl);
                map.put("ssnydpwlb", ssnydpwlb);
                map.put("ssnydpznydmj", ssnydpznydmj);
                map.put("ssnydpzgdmj", ssnydpzgdmj);
                map.put("ssnydpzyjjbntmj", ssnydpzyjjbntmj);


                map.put("tdzzyspzwh", tdzzyspzwh);
                map.put("tdzzyspwly", tdzzyspwly);
                map.put("tdzzyspzmj", tdzzyspzmj);
                map.put("tdzzyspzjg", tdzzyspzjg);
                map.put("tdzzyspzrq", tdzzyspzrq);
                map.put("tdzzystdgypwlxejl", tdzzystdgypwlxejl);
                map.put("tdzzyspwlb", tdzzyspwlb);
                map.put("tdzzyspznydmj", tdzzyspznydmj);
                map.put("tdzzyspzgdmj", tdzzyspzgdmj);
                map.put("tdzzyspzyjjbntmj", tdzzyspzyjjbntmj);


                map.put("qtpzwh", qtpzwh);
                map.put("qtpwly", qtpwly);
                map.put("qtpzmj", qtpzmj);
                map.put("qtpzjg", qtpzjg);
                map.put("qtpzrq", qtpzrq);
                map.put("qttdgypwlxejl", qttdgypwlxejl);
                map.put("qtpwlb", qtpwlb);
                map.put("qtpznydmj", qtpznydmj);
                map.put("qtpzgdmj", qtpzgdmj);
                map.put("qtpzyjjbntmj", qtpzyjjbntmj);

                map.put("lsydpzwh", lsydpzwh);
                map.put("lsydpwly", lsydpwly);
                map.put("lsydpzmj", lsydpzmj);
                map.put("lsydpzjg", lsydpzjg);
                map.put("lsydpzrq", lsydpzrq);
                map.put("lsydtdgypwlxejl", lsydtdgypwlxejl);
                map.put("lsydpwlb", lsydpwlb);
                map.put("lsydpznydmj", lsydpznydmj);
                map.put("lsydpzgdmj", lsydpzgdmj);
                map.put("lsydpzyjjbntmj", lsydpzyjjbntmj);


                map.put("tdgypzwh", tdgypzwh);
                map.put("tdgypwly", tdgypwly);
                map.put("tdgypzmj", tdgypzmj);
                map.put("tdgypzjg", tdgypzjg);
                map.put("tdgypzrq", tdgypzrq);
                map.put("tdgytdgypwlxejl", tdgytdgypwlxejl);
                map.put("tdgypwlb", tdgypwlb);
                map.put("tdgypznydmj", tdgypznydmj);
                map.put("tdgypzgdmj", tdgypzgdmj);
                map.put("tdgypzyjjbntmj", tdgypzyjjbntmj);


                map.put("xxydpzwh", xxydpzwh);
                map.put("xxydpwly", xxydpwly);
                map.put("xxydpzmj", xxydpzmj);
                map.put("xxydpzjg", xxydpzjg);
                map.put("xxydpzrq", xxydpzrq);
                map.put("xxydtdgypwlxejl", xxydtdgypwlxejl);
                map.put("xxydpwlb", xxydpwlb);
                map.put("xxydpznydmj", xxydpznydmj);
                map.put("xxydpzgdmj", xxydpzgdmj);
                map.put("xxydpzyjjbntmj", xxydpzyjjbntmj);


                map.put("yspzwh", yspzwh);
                map.put("yspwly", yspwly);
                map.put("yspzmj", yspzmj);
                map.put("yspzjg", yspzjg);
                map.put("yspzrq", yspzrq);
                map.put("ystdgypwlxejl", ystdgypwlxejl);
                map.put("yspwlb", yspwlb);
                map.put("yspznydmj", yspznydmj);
                map.put("yspzgdmj", yspzgdmj);
                map.put("yspzyjjbntmj", yspzyjjbntmj);


                map.put("isdel", "0");
                map.put("pch", pch);
                map.put("xzqdm", xzqdm);
                map.put("submitdate", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));

                map.put("dkzt", "4");
                rest = xjtbTbBaseMapper.updateDkxxb(map);
            }
        }
        return rest;
    }

    //单个地块面积存储
    @Override
    @Transactional
    public Integer addDkxxbXjDatamj(Map<String, Object> parm) {
        Integer rest = 0;
        String jcbh = parm.get("jcbh").toString();
        String pch = parm.get("pch").toString();
        String xzqdm = parm.get("xzqdm").toString();
        String cffs = parm.get("cffs").toString();
        if(parm.get("cffs").toString().equals("面积拆分"))
        {
            parm.replace("cffs","1");
        }
        else
        {
            parm.replace("cffs","");
        }
        //先全部删除
        Integer k = 0;
        //获取拆分情况 并插入 插入成功 则处理成功
        List<Map<String, Object>> list = (List<Map<String, Object>>) parm.get("lists");
        List<Map<String, Object>> dkbhList = xjtbTbBaseMapper.queryDkbhByJcbh(jcbh);
        if (list != null && list.size() > 0) {
            LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
            if (dkbhList != null && dkbhList.size() == list.size()) {
                for (Map<String, Object> map : list) {
                    String dkbh = map.get("dkbh") + "";
                    if (dkbh.contains(",") && dkbh.indexOf(",") != -1) {
                        String[] arr = dkbh.split(",");
                        for (String s : arr) {
                            Map<String, Object> m = new HashMap();
                            xjtbTbBaseMapper.updateDkxxbXjIsdelState(m);
                        }
                    }
                    map.put("uid", UUID.randomUUID().toString().replace("-", ""));
                    map.put("jcbh", jcbh);
                    map.put("dkbh", map.get("dkbh") + "");
                    map.put("tbbh", map.get("dkbh") + "");
                    map.put("isdel", "0");
                    map.put("pch", pch);
                    map.put("xzqdm", xzqdm);
                    map.put("submitdate", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
                    map.put("dkzt", "0");//刚拆分 全部设置为 0 未填报状态


                    map.replace("thdkmj", Double.parseDouble(map.get("thdkmj").toString()));
                    map.replace("thdkgdmj", Double.parseDouble(map.get("thdkgdmj").toString()));
                    map.replace("thdkzjbntmj", Double.parseDouble(map.get("thdkzjbntmj").toString()));
                    map.replace("thnydmj", Double.parseDouble(map.get("thnydmj").toString()));
                    map.replace("thdkstmj", Double.parseDouble(map.get("thdkstmj").toString()));
                    map.replace("thstbhhxmj", Double.parseDouble(map.get("thstbhhxmj").toString()));

                    if (!isNull(map.get("tbdkmj").toString()).equals("")) {
                        map.replace("tbdkmj", Double.parseDouble(isNull(map.get("tbdkmj").toString())));
                    } else {
                        map.replace("tbdkmj", 0);
                    }
                    if (!isNull(map.get("tbdkqzgdmj").toString()).equals("")) {
                        map.replace("tbdkqzgdmj", Double.parseDouble(map.get("tbdkqzgdmj").toString()));
                    } else {
                        map.replace("tbdkqzgdmj", 0);
                    }
                    if (!isNull(map.get("tbdkqzjbntmj").toString()).equals("")) {
                        map.replace("tbdkqzjbntmj", Double.parseDouble(map.get("tbdkqzjbntmj").toString()));
                    } else {
                        map.replace("tbdkqzjbntmj", 0);
                    }
                    if (!isNull(map.get("tbnydmj").toString()).equals("")) {
                        map.replace("tbnydmj", Double.parseDouble(map.get("tbnydmj").toString()));
                    } else {
                        map.replace("tbnydmj", 0);
                    }
                    if (!isNull(map.get("tbdkstmj").toString()).equals("")) {
                        map.replace("tbdkstmj", Double.parseDouble(map.get("tbdkstmj").toString()));
                    } else {
                        map.replace("tbdkstmj", 0);
                    }
                    if (!isNull(map.get("tbdkstbhhxmj").toString()).equals("")) {
                        map.replace("tbdkstbhhxmj", Double.parseDouble(map.get("tbdkstbhhxmj").toString()));
                    } else {
                        map.replace("tbdkstbhhxmj", 0);
                    }
                    map.replace("wkt", map.get("wkt").toString());

                    map.put("tbr", loginUser.getUsername());
                    map.put("tbsj", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
                    k = rest = xjtbTbBaseMapper.updateDkxxbXjData(map);
                }
            } else {
                xjtbTbBaseMapper.deleteDkxxbXjData(parm);
                for (Map<String, Object> map : list) {
                    String dkbh = map.get("dkbh") + "";
                    if (dkbh.contains(",") && dkbh.indexOf(",") != -1) {
                        String[] arr = dkbh.split(",");
                        for (String s : arr) {
                            Map<String, Object> m = new HashMap();
                            xjtbTbBaseMapper.updateDkxxbXjIsdelState(m);
                        }
                    }
                    map.put("uid", UUID.randomUUID().toString().replace("-", ""));
                    map.put("jcbh", jcbh);
                    map.put("dkbh", map.get("dkbh") + "");
                    map.put("tbbh", map.get("dkbh") + "");
                    map.put("isdel", "0");
                    map.put("pch", pch);
                    map.put("xzqdm", xzqdm);
                    map.put("submitdate", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
                    map.put("dkzt", "0");//刚拆分 全部设置为 0 未填报状态


                    map.replace("thdkmj", Double.parseDouble(map.get("thdkmj").toString()));
                    map.replace("thdkgdmj", Double.parseDouble(map.get("thdkgdmj").toString()));
                    map.replace("thdkzjbntmj", Double.parseDouble(map.get("thdkzjbntmj").toString()));
                    map.replace("thnydmj", Double.parseDouble(map.get("thnydmj").toString()));
                    map.replace("thdkstmj", Double.parseDouble(map.get("thdkstmj").toString()));
                    map.replace("thstbhhxmj", Double.parseDouble(map.get("thstbhhxmj").toString()));

                    if (!isNull(map.get("tbdkmj").toString()).equals("")) {
                        map.replace("tbdkmj", Double.parseDouble(isNull(map.get("tbdkmj").toString())));
                    } else {
                        map.replace("tbdkmj", 0);
                    }
                    if (!isNull(map.get("tbdkqzgdmj").toString()).equals("")) {
                        map.replace("tbdkqzgdmj", Double.parseDouble(map.get("tbdkqzgdmj").toString()));
                    } else {
                        map.replace("tbdkqzgdmj", 0);
                    }
                    if (!isNull(map.get("tbdkqzjbntmj").toString()).equals("")) {
                        map.replace("tbdkqzjbntmj", Double.parseDouble(map.get("tbdkqzjbntmj").toString()));
                    } else {
                        map.replace("tbdkqzjbntmj", 0);
                    }
                    if (!isNull(map.get("tbnydmj").toString()).equals("")) {
                        map.replace("tbnydmj", Double.parseDouble(map.get("tbnydmj").toString()));
                    } else {
                        map.replace("tbnydmj", 0);
                    }
                    if (!isNull(map.get("tbdkstmj").toString()).equals("")) {
                        map.replace("tbdkstmj", Double.parseDouble(map.get("tbdkstmj").toString()));
                    } else {
                        map.replace("tbdkstmj", 0);
                    }
                    if (!isNull(map.get("tbdkstbhhxmj").toString()).equals("")) {
                        map.replace("tbdkstbhhxmj", Double.parseDouble(map.get("tbdkstbhhxmj").toString()));
                    } else {
                        map.replace("tbdkstbhhxmj", 0);
                    }
                    map.replace("wkt", map.get("wkt").toString());
                    map.put("uid", UUID.randomUUID().toString().replace("-", ""));

                    map.put("tbr", loginUser.getUsername());
                    map.put("tbsj", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
                    k = xjtbTbBaseMapper.addDkxxbXjData11(map);
                }
            }
            if (k > 0) {
                rest = xjtbTbBaseMapper.updateTbxxbXjSaveState(parm); //iscl 设置为 1  更新方式
            }
        }
        return rest;
    }

    @Override
    public List<Map> getXzqmc(Map<String, Object> parm) {
        return xjtbTbBaseMapper.getXzqmc(parm);
    }

    @Override
    public List<Map> getXzq(Map<String, Object> parm) {
        return xjtbTbBaseMapper.getXzq(parm);
    }

    @Override
    public List<Map> getdkXzq(Map<String, Object> parm) {
        return xjtbTbBaseMapper.getdkXzq(parm);
    }

    @Override
    public List<WpCjTbxxbxj2023DTO> queryTbInfoByIndex(Map<String, Object> parm) {
        return xjtbTbBaseMapper.queryTbInfoByIndex(parm);
    }

    @Override
    public List<Map> getdkXzqmc(Map<String, Object> parm) {
        return xjtbTbBaseMapper.getdkXzqmc(parm);
    }

    @Override
    public List<WpCjTbjt2023DTO> querytbjtBytbbhsheng(Map<String, Object> parm) {
        String tbbh = parm.get("jcbh") + "";  //直接使用监测编号
        String xzqdm = parm.get("xzqdm").toString();
        String pch = parm.get("pch").toString();
        String url = "";
        String yf = "";
        if ("上半年-农房".equals(pch)) {
            yf = "上半年";
        } else if (pch != null && pch.length() != 0) {
            yf = pch;
        }
        String xzq = parm.get("xzqdm").toString().substring(0, 2);
        String dkbh = MyStringUtils.truncateString(tbbh);
        List<WpCjTbjt2023DTO> lists = new ArrayList<>();
        WpCjTbjt2023DTO model = new WpCjTbjt2023DTO();

        model.setName("耕地套合示意图");
        url = "https://obs-top.obs.cn-north-1.myhuaweicloud.com/upload/photo/wpzf2023/" + yf + "/" + xzq + "/" + xzqdm + "/" + xzqdm + "_" + dkbh + "_GD.jpg";
        model.setUrl(url);
        lists.add(model);

        model = new WpCjTbjt2023DTO();
        model.setName("自录批文示意图");
        url = "https://obs-top.obs.cn-north-1.myhuaweicloud.com/upload/photo/wpzf2023/" + yf + "/" + xzq + "/" + xzqdm + "/" + xzqdm + "_" + dkbh + "_TBZLPW.jpg";
        model.setUrl(url);
        lists.add(model);

        model = new WpCjTbjt2023DTO();
        model.setName("设施、临时用地备案示意图");
        url = "https://obs-top.obs.cn-north-1.myhuaweicloud.com/upload/photo/wpzf2023/" + yf + "/" + xzq + "/" + xzqdm + "/" + xzqdm + "_" + dkbh + "_LSYDSSNYD.jpg";
        model.setUrl(url);
        lists.add(model);


        model = new WpCjTbjt2023DTO();
        model.setName("用地管理信息套合示意图");
        url = "https://obs-top.obs.cn-north-1.myhuaweicloud.com/upload/photo/wpzf2023/" + yf + "/" + xzq + "/" + xzqdm + "/" + xzqdm + "_" + dkbh + "_TBYD.jpg";
        model.setUrl(url);
        lists.add(model);


        //重新获取批次号 wpzftbbaseMapper
//        Map<String, Object> map = wpzftbbaseMapper.getoldpch(parm);
//        String oldpch = "";
//        if (map != null) {
//            oldpch = map.get("pch").toString();
//            if ("上半年-农房".equals(oldpch)) {
//                oldpch = "上半年";
//            } else if (oldpch != null && oldpch.length() != 0) {
//                oldpch = oldpch;
//            }
//            model = new WpCjTbjt2023DTO();
//            model.setName("初次-自录批文示意图");
//            url = "https://obs-top.obs.cn-north-1.myhuaweicloud.com/upload/photo/wpzf2023/" + oldpch + "/" + xzq + "/" + xzqdm + "/" + xzqdm + "_" + dkbh + "_LSYDSSNYD.jpg";
//            model.setUrl(url);
//            lists.add(model);
//        }


        return lists;
    }

    @Override
    public List<WpCjTbjt2023DTO> querytbjtBytbbhsheng1(Map<String, Object> parm) {
        String tbbh = parm.get("jcbh") + "";  //直接使用监测编号
        String xzqdm = parm.get("xzqdm").toString();
        String pch = parm.get("pch").toString();
        String url = "";
        String yf = "";

        if ("上半年-农房".equals(pch)) {
            yf = "上半年";
        } else if (pch != null && pch.length() != 0) {
            yf = pch;
        }
        String xzq = parm.get("xzqdm").toString().substring(0, 2);
        String dkbh = MyStringUtils.truncateString(tbbh);
        List<WpCjTbjt2023DTO> lists = new ArrayList<>();
        WpCjTbjt2023DTO model = new WpCjTbjt2023DTO();
        String xzqmc="";
        if(xzq.equals("15"))
        {
            xzqmc="内蒙古自治区";
        }
        else if(xzq.equals("21"))
        {
            xzqmc="辽宁省";
        }
        if (pch.contains("自主提取")) {
            model = new WpCjTbjt2023DTO();
            model.setName("用地管理信息套合示意图");
            url = "https://obs-top.obs.cn-north-1.myhuaweicloud.com/upload/photo/wpzf2024/"+xzqmc+"/套合截图/"+pch+"/" + xzqdm + "/" + xzqdm + "_" + dkbh + "_YDGL.jpg";
            model.setUrl(url);
            lists.add(model);

            model = new WpCjTbjt2023DTO();
            model.setName("耕地套合示意图");
            url = "https://obs-top.obs.cn-north-1.myhuaweicloud.com/upload/photo/wpzf2024/"+xzqmc+"/套合截图/"+pch+"/" + xzqdm + "/" + xzqdm + "_" + dkbh + "_GD.jpg";
            model.setUrl(url);
            lists.add(model);


            model = new WpCjTbjt2023DTO();
            model.setName("设施农用地备案示意图");
            url = "https://obs-top.obs.cn-north-1.myhuaweicloud.com/upload/photo/wpzf2024/"+xzqmc+"/套合截图/"+pch+"/" + xzqdm + "/" + xzqdm + "_" + dkbh + "_SSNYD.jpg";
            model.setUrl(url);
            lists.add(model);
        } else {
            model = new WpCjTbjt2023DTO();
            model.setName("用地管理信息套合示意图");
            url = "https://obs-top.obs.cn-north-1.myhuaweicloud.com/upload/photo/wpzf2024/一季度/国家下发/" + xzqdm + "/" + xzqdm + "_" + dkbh + "_YDGL.jpg";
            model.setUrl(url);
            lists.add(model);

            model = new WpCjTbjt2023DTO();
            model.setName("耕地套合示意图");
            url = "https://obs-top.obs.cn-north-1.myhuaweicloud.com/upload/photo/wpzf2024/一季度/国家下发/" + xzqdm + "/" + xzqdm + "_" + dkbh + "_GD.jpg";
            model.setUrl(url);
            lists.add(model);


            model = new WpCjTbjt2023DTO();
            model.setName("设施农用地备案示意图");
            url = "https://obs-top.obs.cn-north-1.myhuaweicloud.com/upload/photo/wpzf2024/一季度/国家下发/" + xzqdm + "/" + xzqdm + "_" + dkbh + "_SSNYD.jpg";
            model.setUrl(url);
            lists.add(model);
        }


        //重新获取批次号 wpzftbbaseMapper
//        Map<String, Object> map = wpzftbbaseMapper.getoldpch(parm);
//        String oldpch = "";
//        if (map != null) {
//            oldpch = map.get("pch").toString();
//            if ("上半年-农房".equals(oldpch)) {
//                oldpch = "上半年";
//            } else if (oldpch != null && oldpch.length() != 0) {
//                oldpch = oldpch;
//            }
//            model = new WpCjTbjt2023DTO();
//            model.setName("初次-自录批文示意图");
//            url = "https://obs-top.obs.cn-north-1.myhuaweicloud.com/upload/photo/wpzf2023/" + oldpch + "/" + xzq + "/" + xzqdm + "/" + xzqdm + "_" + dkbh + "_LSYDSSNYD.jpg";
//            model.setUrl(url);
//            lists.add(model);
//        }


        return lists;
    }

    @Override
    public ModelMap getShowImgsnew(Map<String, Object> parm) {
        ModelMap map = new ModelMap();
        try {
            String tbbhs = parm.get("tbbh") + "";
            String xzqdm = parm.get("xzqdm") + "";
            String pch = parm.get("pch") + "";
            String postURL = "";
            String data = "";
            String strXzqdm = parm.get("xzqdm").toString().substring(0, 2);
            {
                postURL = "https://jg.landcloud.org.cn:8553/webapi/token";
                data = "client_id=web&client_secret=e46232c20609435eba54b7576de935dd&grant_type=password&username=a53e0c14ee900728f36bba014d975982&password=b30c775c48e9ba92ade95e427a5242b0";
            }
            URL url = new URL(postURL);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("accept", "*/*");
            conn.setRequestProperty("connection", "Keep-Alive");
            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");

            conn.setDoOutput(true);
            conn.setDoInput(true);
            OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream(), "utf-8");

            out.write(data);
            //缓冲数据
            out.flush();
            //获取URLConnection对象对应的输入流
            InputStream is = conn.getInputStream();
            int count = 0;
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            byte[] buffer = new byte[4096];
            while ((count = is.read(buffer)) != -1) {
                byteArrayOutputStream.write(buffer, 0, count);
            }
            byte[] datas = byteArrayOutputStream.toByteArray();

            byteArrayOutputStream.close();
            //关闭流
            is.close();

            conn.disconnect();
            String result = new String(datas, 0, datas.length, "utf-8");
            List<String> items = new ArrayList<>();
            {
                String t = getImgnew(result, "00gty_wpzf_dk", xzqdm, tbbhs);
                items.add(t);
                map.put("data", items);
            }
        } catch (MalformedURLException ex) {
            throw new RuntimeException(ex);
        } catch (UnsupportedEncodingException ex) {
            throw new RuntimeException(ex);
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
        return map;
    }


    public String getImgnew(String str, String ywmb, String xzqdm, String tbbh) {
        String rest = "";
        try {
            String postURL = "";
            String token = "";
            String token_type = "";
            Map mapType = JSON.parseObject(str, Map.class);
            {
                for (Object obj : mapType.keySet()) {

                    if ((obj + "").equals("access_token")) {
                        token = mapType.get("access_token") + "";
                        token_type = mapType.get("token_type") + "";
                    }
                }
                System.out.println(token);
                //接口地址
                postURL = "https://dc2.landcloud.org.cn:9443/webapi/api/open/GetWPZFTBInfo";
            }
            URL url = new URL(postURL);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("POST");
            String encoding = Base64.encode(str.getBytes());
            conn.setRequestProperty("accept", "*/*");
            conn.setRequestProperty("Charset", "utf-8");
            conn.setRequestProperty("connection", "Keep-Alive");
            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
            conn.setRequestProperty("Content-Type", "application/json;charset=utf-8 ");
            conn.setRequestProperty("Authorization", token_type + " " + token);
            //  conn.setRequestProperty("token", token);
            conn.setDoOutput(true);
            conn.setDoInput(true);
            conn.setConnectTimeout(2000);
            conn.setReadTimeout(2000);
            //获取URLConnection对象对应的输出流
            OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream(), "utf-8");
            //  out = new PrintWriter(conn.getOutputStream());
            //发送请求参数即数据
            //String xmbh="210115S120240216LJ00005";
            if (StringUtils.isNotBlank(xzqdm)) {
                //String data = "{\"xzqdm\":\"" + xzqdm + "\",\"ywmb\":\"" + ywmb + "\"}";
                String data = "{\"xzqdm\":\"" + xzqdm + "\",\"ywmb\":\"" + ywmb + "\",\"xmbh\":[\"" + tbbh + "\"]}";
                System.out.println("---------获取地块列表参数------" + data);
                out.write(data);
                out.flush();
                InputStream is = conn.getInputStream();
                int count = 0;
                ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                byte[] buffer = new byte[4096];
                while ((count = is.read(buffer)) != -1) {
                    byteArrayOutputStream.write(buffer, 0, count);
                }
                byte[] datas = byteArrayOutputStream.toByteArray();

                byteArrayOutputStream.close();
                is.close();
                conn.disconnect();
                rest = new String(datas, 0, datas.length, "utf-8");
            }

        } catch (Exception e) {
            rest = "网络异常，请稍后重试！";
            //writeLog(UtilTool.GetTime_1()+"："+e.getMessage()+"\n");
            throw new RuntimeException(e.getMessage());
        }
        return rest;
    }

    @Override
    public Map<String, Object> getFjInfo(Map<String, Object> map) {
        return xjtbTbBaseMapper.getFjInfo(map);
    }

    @Override
    public Integer addFjInfo(Map<String, Object> map) {
        Integer rest = 0;

        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        map.put("uploadusername", loginUser.getUsername());
        map.put("uploadtime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));

        Map<String, Object> fjInfo = getFjInfo(map);
        if (fjInfo != null) {
            rest = xjtbTbBaseMapper.updateFjInfo(map);
        } else {
            rest = xjtbTbBaseMapper.saveFjInfo(map);
        }
        return rest;
    }

    @Override
    public Integer deleteFjInfo(Map<String, Object> map) {
        return xjtbTbBaseMapper.deleteFjInfo(map);
    }

    @Override
    public WpCjGsinfoly2024DTO getGsinfoly(Map<String, Object> parm) {
        return xjtbTbBaseMapper.getGsinfoly(parm);
    }

    @Override
    public List<Map<String, Object>> queryRelatedk(Map<String, Object> parm) {
        return xjtbTbBaseMapper.queryRelatedk(parm);
    }

    @Override
    public List<Map<String, Object>> queryDkbhByTbbh(Map<String, Object> parm) {
        return xjtbTbBaseMapper.queryDkbhByTbbh(parm);
    }

    @Override
    public List<Map<String, Object>> queryDelDkByWyTask(Map<String, Object> parm) {
        return xjtbTbBaseMapper.queryDelDkByWyTask(parm);
    }

    @Override
    public Integer updateTaskCount(Map<String, Object> parm) {
        return xjtbTbBaseMapper.updateTaskCount(parm);
    }

    @Override
    public Integer deleteWyrwTaskdetail(Map<String, Object> parm) {
        return xjtbTbBaseMapper.deleteWyrwTaskdetail(parm);
    }

    @Override
    public Integer deleteWyrwTaskdetailAnnex(Map<String, Object> parm) {
        return xjtbTbBaseMapper.deleteWyrwTaskdetailAnnex(parm);
    }

    @Override
    public Integer deleteRelatedk(Map<String, Object> parm) {
        return xjtbTbBaseMapper.deleteRelatedk(parm);
    }

    @Override
    public List<Map<String, Object>> queryRelateTb(Map<String, Object> parm) {
        return null;
    }

    @Override
    public int updateRalateTb(Map<String, Object> parm) {
        return xjtbTbBaseMapper.updateRalateTb(parm);
    }

    @Override
    public List<Map<String, Object>> queryRelatetb(Map<String, Object> parm) {
        return xjtbTbBaseMapper.queryRelatetb(parm);
    }

    public String getImg(String str, String xmbh, String xzqdm) {
        String rest = "";
        try {
            String postURL = "";
            String token = "";
            String token_type = "";
            String strXzqdm = xzqdm.substring(0, 2);
            Map mapType = JSON.parseObject(str, Map.class);
            {
                //  Map mapType = JSON.parseObject(str, Map.class);
                for (Object obj : mapType.keySet()) {

                    if ((obj + "").equals("access_token")) {
                        token = mapType.get("access_token") + "";
                        token_type = mapType.get("token_type") + "";
                    }
                }
                System.out.println(token);
                //接口地址
                postURL = "https://jg.landcloud.org.cn:8553/webapi/api/nyhc/GetTBDetail";
            }


            URL url = new URL(postURL);
            //打开和url之间的连接
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();

            //请求方式
            conn.setRequestMethod("POST");
            //设置通用的请求属性
            String encoding = Base64.encode(str.getBytes());
            conn.setRequestProperty("accept", "*/*");
            conn.setRequestProperty("Charset", "utf-8");
            conn.setRequestProperty("connection", "Keep-Alive");
            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
            conn.setRequestProperty("Content-Type", "application/json;charset=utf-8 ");
            conn.setRequestProperty("Authorization", token_type + " " + token);
            //  conn.setRequestProperty("token", token);
            conn.setDoOutput(true);
            conn.setDoInput(true);
            conn.setConnectTimeout(2000);
            conn.setReadTimeout(2000);
            //获取URLConnection对象对应的输出流
            OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream(), "utf-8");
            //  out = new PrintWriter(conn.getOutputStream());
            //发送请求参数即数据


            if (StringUtils.isNotBlank(xmbh)) {

                String data = "{\"xmbh\":[\"" + xmbh + "\"],\"xzqdm\":\"" + xzqdm + "\"}";
                System.out.println("---------3232------" + data);
                out.write(data);
                //缓冲数据
                out.flush();
                //获取URLConnection对象对应的输入流
                InputStream is = conn.getInputStream();

                int count = 0;

                ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();

                byte[] buffer = new byte[4096];

                while ((count = is.read(buffer)) != -1) {

                    byteArrayOutputStream.write(buffer, 0, count);
                }
                byte[] datas = byteArrayOutputStream.toByteArray();

                byteArrayOutputStream.close();
                is.close();
                conn.disconnect();
                rest = new String(datas, 0, datas.length, "utf-8");
                System.out.println(rest);
                //writeLog(UtilTool.GetTime_1()+"：结束请求举证照片接口\n");
            }

        } catch (Exception e) {
            rest = "网络异常，请稍后重试！";
            //writeLog(UtilTool.GetTime_1()+"："+e.getMessage()+"\n");
            throw new RuntimeException(e.getMessage());
        }
        return rest;
    }

    public List<Map<String, Object>> queryLz(Map<String, Object> parm) {
        return xjtbTbBaseMapper.queryLz(parm);
    }

    public String queryThyy(Map<String, Object> parm) {
        return xjtbTbBaseMapper.queryThyy(parm);
    }

    @Override
    public Integer updateImgInfo(Map<String, Object> parm) {
        return xjtbTbBaseMapper.updateImgInfo(parm);
    }

    @Override
    @Transactional
    public Integer deleteImg(Map<String, Object> parm) {
        Integer rest = 0;
        Map<String, Object> map = xjtbTbBaseMapper.queryDeleteImgByUuid(parm);
        if (map != null) {
            rest = xjtbTbBaseMapper.deleteImg(parm);
            if (rest > 0) {
                LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
                map.put("user_id", loginUser.getUserid());
                map.put("nick_name", loginUser.getSysUser().getNickName());
                map.put("user_name", loginUser.getSysUser().getUserName());
                map.put("submitdate", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
                xjtbTbBaseMapper.saveDeleteImgLog(map);
            }
        }
        return rest;
    }

    @Override
    public List<Map<String, Object>> queryDeleteImg(Map<String, Object> parm) {
        return xjtbTbBaseMapper.queryDeleteImg(parm);
    }

    @Override
    public List<YtbTbInfo> queryXjBtgdk(Map<String, Object> parm) {
        List<YtbTbInfo> rest = new ArrayList<>();
        //参数中 获取是否有dkzt
        List<Map<String, Object>> list = ytbTbInfoMapper.queryDkxxbxj(parm);
        for (Map<String, Object> map : list) {
            YtbTbInfo ytbTbInfo = new YtbTbInfo();

            ytbTbInfo.setIndex((Long) map.get("index"));
            ytbTbInfo.setJcbh(map.get("jcbh") + "");
            ytbTbInfo.setDkbh(map.get("dkbh") + "");
            ytbTbInfo.setPch(map.get("pch") + "");
            ytbTbInfo.setXzqdm(map.get("xzqdm") + "");
            ytbTbInfo.setPdlx(map.get("pdlx") + "");
            ytbTbInfo.setJtqx(map.get("jtqx") + "");
            ytbTbInfo.setJtlx(map.get("jtlx") + "");
            ytbTbInfo.setWflx(map.get("wflx") + "");
            ytbTbInfo.setSjyt(map.get("sjyt") + "");
            ytbTbInfo.setPdyjsm(map.get("pdyjsm") + "");
            ytbTbInfo.setDkzt(map.get("dkzt") + "");
            ytbTbInfo.setXian(map.get("xian") + "");
            ytbTbInfo.setGjxfhzztq(map.get("gjxfhzztq") + "");

            String jcbh = map.get("jcbh") + "";
            Map<String, Object> tbxxbxj = new HashMap<>();
            if (jcbh.indexOf(",") != -1) {
                String[] s = jcbh.split(",");
                tbxxbxj = ytbTbInfoMapper.queryTbxxbxj(s[0]);
            } else {
                tbxxbxj = ytbTbInfoMapper.queryTbxxbxj(jcbh);
            }

            if (tbxxbxj != null) {
                ytbTbInfo.setTblx(tbxxbxj.get("tblx") + "");
                ytbTbInfo.setSheng(tbxxbxj.get("smc") + "");
                ytbTbInfo.setShi(tbxxbxj.get("smc1") + "");
                ytbTbInfo.setXian(tbxxbxj.get("qxmc") + "");
                ytbTbInfo.setXz(tbxxbxj.get("mjzbzddxzjxzqmc") + "");
                ytbTbInfo.setCun(tbxxbxj.get("mjzbzddcjxzqmc") + "");
            }
            rest.add(ytbTbInfo);
        }
        return rest;
    }

    @Override
    public Integer queryXjBtgdkCount(Map<String, Object> parm) {
        return ytbTbInfoMapper.queryDkxxbxjCount(parm);
    }

    @Override
    public Integer saveXjBtgdk(Map<String, Object> parm) {
        Integer rest = 0;
        String jcbh = parm.get("jcbh").toString();
        String pch = parm.get("pch").toString();
        String xzqdm = parm.get("xzqdm").toString();
        String olddkbh = parm.get("olddkbh").toString();

        String pwgs = "";
        //农专用
        String nydzypzwh = "";
        String nydzypwly = "";
        String nydzypzmj = "";
        String nydzypzjg = "";
        String nydzypzrq = "";

        String nydzytdgypwlxejl = "";
        String nydzypwlb = "";
        String nydzypznydmj = "";
        String nydzypzgdmj = "";
        String nydzypzyjjbntmj = "";

        //增减挂钩
        String zjggpzwh = "";
        String zjggpwly = "";
        String zjggpzmj = "";
        String zjggpzjg = "";
        String zjggpzrq = "";

        String zjggtdgypwlxejl = "";
        String zjggpwlb = "";
        String zjggpznydmj = "";
        String zjggpzgdmj = "";
        String zjggpzyjjbntmj = "";

        //工矿废弃地
        String gkfqdpzwh = "";
        String gkfqdpwly = "";
        String gkfqdpzmj = "";
        String gkfqdpzjg = "";
        String gkfqdpzrq = "";

        String gkfqdtdgypwlxejl = "";
        String gkfqdpwlb = "";
        String gkfqdpznydmj = "";
        String gkfqdpzgdmj = "";
        String gkfqdpzyjjbntmj = "";

        //不动产权证书
        String bdcqzspzwh = "";
        String bdcqzspwly = "";
        String bdcqzspzmj = "";
        String bdcqzspzjg = "";
        String bdcqzspzrq = "";

        String bdcqzstdgypwlxejl = "";
        String bdcqzspwlb = "";
        String bdcqzszpznydmj = "";
        String bdcqzspzgdmj = "";
        String bdcqzszyjjbntmj = "";

        //设施农用地
        String ssnydpzwh = "";
        String ssnydpwly = "";
        String ssnydpzmj = "";
        String ssnydpzjg = "";
        String ssnydpzrq = "";


        String ssnydtdgypwlxejl = "";
        String ssnydpwlb = "";
        String ssnydpznydmj = "";
        String ssnydpzgdmj = "";
        String ssnydpzyjjbntmj = "";

        //土地整治验收
        String tdzzyspzwh = "";
        String tdzzyspwly = "";
        String tdzzyspzmj = "";
        String tdzzyspzjg = "";
        String tdzzyspzrq = "";

        String tdzzystdgypwlxejl = "";
        String tdzzyspwlb = "";
        String tdzzyspznydmj = "";
        String tdzzyspzgdmj = "";
        String tdzzyspzyjjbntmj = "";

        //其他
        String qtpzwh = "";
        String qtpwly = "";
        String qtpzmj = "";
        String qtpzjg = "";
        String qtpzrq = "";

        String qttdgypwlxejl = "";
        String qtpwlb = "";
        String qtpznydmj = "";
        String qtpzgdmj = "";
        String qtpzyjjbntmj = "";

        //临时用地
        String lsydpzwh = "";
        String lsydpwly = "";
        String lsydpzmj = "";
        String lsydpzjg = "";
        String lsydpzrq = "";

        String lsydtdgypwlxejl = "";
        String lsydpwlb = "";
        String lsydpznydmj = "";
        String lsydpzgdmj = "";
        String lsydpzyjjbntmj = "";

        //土地供应
        String tdgypzwh = "";
        String tdgypwly = "";
        String tdgypzmj = "";
        String tdgypzjg = "";
        String tdgypzrq = "";

        String tdgytdgypwlxejl = "";
        String tdgypwlb = "";
        String tdgypznydmj = "";
        String tdgypzgdmj = "";
        String tdgypzyjjbntmj = "";

        //先行用地
        String xxydpzwh = "";
        String xxydpwly = "";
        String xxydpzmj = "";
        String xxydpzjg = "";
        String xxydpzrq = "";

        String xxydtdgypwlxejl = "";
        String xxydpwlb = "";
        String xxydpznydmj = "";
        String xxydpzgdmj = "";
        String xxydpzyjjbntmj = "";

        //预审
        String yspzwh = "";
        String yspwly = "";
        String yspzmj = "";
        String yspzjg = "";
        String yspzrq = "";

        String ystdgypwlxejl = "";
        String yspwlb = "";
        String yspznydmj = "";
        String yspzgdmj = "";
        String yspzyjjbntmj = "";

        List<Map<String, Object>> list = (List<Map<String, Object>>) parm.get("lists");
        if (list != null && list.size() > 0) {
            for (Map<String, Object> map : list) {
                //更新 信息

                List<Map<String, Object>> hfpwList = (List<Map<String, Object>>) map.get("hfpwlist");
                if (hfpwList != null && hfpwList.size() > 0) {

                    map.put("hf_hfydpw", hfpwList.size());

                    if (hfpwList != null && hfpwList.size() > 0) {
                        int sort = 0;
                        xjtbTbBaseMapper.deleteDkxxbxjPw(map);
                        for (Map<String, Object> m : hfpwList) {
                            m.put("sort", sort++);
                            m.put("dkbh", map.get("dkbh"));
                            m.put("tbbh", map.get("dkbh"));
                            m.put("jcbh", jcbh);
                            m.put("pch", pch);
                            m.put("xzqdm", xzqdm);

                            xjtbTbBaseMapper.saveDkxxbxjPw(m);
                            if (m.get("hf_pwlx").toString().equals("农用地转用")) {
                                nydzypzwh += m.get("hf_pzwh").toString() + ",";
                                nydzypwly += m.get("hf_pwly").toString() + ",";
                                nydzypzmj += m.get("hf_pzmj").toString() + ",";
                                //nydzypzjg+=m.get("hf_pzjg").toString()+",";
                                nydzypzrq += m.get("hf_pzrq").toString() + ",";

                                nydzytdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                nydzypwlb += m.get("hf_pwlb").toString() + ",";
                                nydzypznydmj += m.get("hf_pznydmj").toString() + ",";
                                nydzypzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                nydzypzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("增减挂钩")) {
                                zjggpzwh += m.get("hf_pzwh").toString() + ",";
                                zjggpwly += m.get("hf_pwly").toString() + ",";
                                zjggpzmj += m.get("hf_pzmj").toString() + ",";
                                //zjggpzjg+=m.get("hf_pzjg").toString()+",";
                                zjggpzrq += m.get("hf_pzrq").toString() + ",";

                                zjggtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                zjggpwlb += m.get("hf_pwlb").toString() + ",";
                                zjggpznydmj += m.get("hf_pznydmj").toString() + ",";
                                zjggpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                zjggpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("工矿废弃地")) {
                                gkfqdpzwh += m.get("hf_pzwh").toString() + ",";
                                gkfqdpwly += m.get("hf_pwly").toString() + ",";
                                gkfqdpzmj += m.get("hf_pzmj").toString() + ",";
                                //gkfqdpzjg+=m.get("hf_pzjg").toString()+",";
                                gkfqdpzrq += m.get("hf_pzrq").toString() + ",";

                                gkfqdtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                gkfqdpwlb += m.get("hf_pwlb").toString() + ",";
                                gkfqdpznydmj += m.get("hf_pznydmj").toString() + ",";
                                gkfqdpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                gkfqdpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("不动产权证书")) {

                                bdcqzspzwh += m.get("hf_pzwh").toString() + ",";
                                bdcqzspwly += m.get("hf_pwly").toString() + ",";
                                bdcqzspzmj += m.get("hf_pzmj").toString() + ",";
                                //bdcqzspzjg+=m.get("hf_pzjg").toString()+",";
                                bdcqzspzrq += m.get("hf_pzrq").toString() + ",";

                                bdcqzstdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                bdcqzspwlb += m.get("hf_pwlb").toString() + ",";
                                bdcqzszpznydmj += m.get("hf_pznydmj").toString() + ",";
                                bdcqzspzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                bdcqzszyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("设施农用地")) {
                                ssnydpzwh += m.get("hf_pzwh").toString() + ",";
                                ssnydpwly += m.get("hf_pwly").toString() + ",";
                                ssnydpzmj += m.get("hf_pzmj").toString() + ",";
                                //ssnydpzjg+=m.get("hf_pzjg").toString()+",";
                                ssnydpzrq += m.get("hf_pzrq").toString() + ",";

                                ssnydtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                ssnydpwlb += m.get("hf_pwlb").toString() + ",";
                                ssnydpznydmj += m.get("hf_pznydmj").toString() + ",";
                                ssnydpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                ssnydpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("土地整治验收")) {
                                tdzzyspzwh += m.get("hf_pzwh").toString() + ",";
                                tdzzyspwly += m.get("hf_pwly").toString() + ",";
                                tdzzyspzmj += m.get("hf_pzmj").toString() + ",";
                                //tdzzyspzjg+=m.get("hf_pzjg").toString()+",";
                                tdzzyspzrq += m.get("hf_pzrq").toString() + ",";

                                tdzzystdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                tdzzyspwlb += m.get("hf_pwlb").toString() + ",";
                                tdzzyspznydmj += m.get("hf_pznydmj").toString() + ",";
                                tdzzyspzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                tdzzyspzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";

                            } else if (m.get("hf_pwlx").toString().equals("其他")) {
                                qtpzwh += m.get("hf_pzwh").toString() + ",";
                                qtpwly += m.get("hf_pwly").toString() + ",";
                                qtpzmj += m.get("hf_pzmj").toString() + ",";
                                //qtpzjg+=m.get("hf_pzjg").toString()+",";
                                qtpzrq += m.get("hf_pzrq").toString() + ",";

                                qttdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                qtpwlb += m.get("hf_pwlb").toString() + ",";
                                qtpznydmj += m.get("hf_pznydmj").toString() + ",";
                                qtpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                qtpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("临时用地")) {
                                lsydpzwh += m.get("hf_pzwh").toString() + ",";
                                lsydpwly += m.get("hf_pwly").toString() + ",";
                                lsydpzmj += m.get("hf_pzmj").toString() + ",";
                                //lsydpzjg+=m.get("hf_pzjg").toString()+",";
                                lsydpzrq += m.get("hf_pzrq").toString() + ",";

                                lsydtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                lsydpwlb += m.get("hf_pwlb").toString() + ",";
                                lsydpznydmj += m.get("hf_pznydmj").toString() + ",";
                                lsydpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                lsydpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";

                            } else if (m.get("hf_pwlx").toString().equals("土地供应")) {
                                tdgypzwh += m.get("hf_pzwh").toString() + ",";
                                tdgypwly += m.get("hf_pwly").toString() + ",";
                                tdgypzmj += m.get("hf_pzmj").toString() + ",";
                                //tdgypzjg=m.get("hf_pzjg").toString()+",";
                                tdgypzrq += m.get("hf_pzrq").toString() + ",";

                                tdgytdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                tdgypwlb += m.get("hf_pwlb").toString() + ",";
                                tdgypznydmj += m.get("hf_pznydmj").toString() + ",";
                                tdgypzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                tdgypzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("先行用地")) {
                                //先行用地
                                xxydpzwh += m.get("hf_pzwh").toString() + ",";
                                xxydpwly += m.get("hf_pwly").toString() + ",";
                                xxydpzmj += m.get("hf_pzmj").toString() + ",";
                                //xxydpzjg+=m.get("hf_pzjg").toString()+",";
                                xxydpzrq += m.get("hf_pzrq").toString() + ",";

                                xxydtdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                xxydpwlb += m.get("hf_pwlb").toString() + ",";
                                xxydpznydmj += m.get("hf_pznydmj").toString() + ",";
                                xxydpzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                xxydpzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            } else if (m.get("hf_pwlx").toString().equals("预审")) {
                                yspzwh += m.get("hf_pzwh").toString() + ",";
                                yspwly += m.get("hf_pwly").toString() + ",";
                                yspzmj += m.get("hf_pzmj").toString() + ",";
                                //yspzjg=m.get("hf_pzjg").toString()+",";
                                yspzrq += m.get("hf_pzrq").toString() + ",";

                                ystdgypwlxejl += m.get("hf_tdgypwlxejl").toString() + ",";
                                yspwlb += m.get("hf_pwlb").toString() + ",";
                                yspznydmj += m.get("hf_pznydmj").toString() + ",";
                                yspzgdmj += m.get("hf_pzgdmj").toString() + ",";
                                yspzyjjbntmj += m.get("hf_pzyjjbntmj").toString() + ",";
                            }
                        }
                    }
                    map.put("pwgs", hfpwList.size());
                } else {
                    map.put("pwgs", 0);
                }

                map.put("nydzypzwh", nydzypzwh);
                map.put("nydzypwly", nydzypwly);
                map.put("nydzypzmj", nydzypzmj);
                map.put("nydzypzjg", nydzypzjg);
                map.put("nydzypzrq", nydzypzrq);
                map.put("nydzytdgypwlxejl", nydzytdgypwlxejl);
                map.put("nydzypwlb", nydzypwlb);
                map.put("nydzypznydmj", nydzypznydmj);
                map.put("nydzypzgdmj", nydzypzgdmj);
                map.put("nydzypzyjjbntmj", nydzypzyjjbntmj);


                map.put("zjggpzwh", zjggpzwh);
                map.put("zjggpwly", zjggpwly);
                map.put("zjggpzmj", zjggpzmj);
                map.put("zjggpzjg", zjggpzjg);
                map.put("zjggpzrq", zjggpzrq);
                map.put("zjggtdgypwlxejl", zjggtdgypwlxejl);
                map.put("zjggpwlb", zjggpwlb);
                map.put("zjggpznydmj", zjggpznydmj);
                map.put("zjggpzgdmj", zjggpzgdmj);
                map.put("zjggpzyjjbntmj", zjggpzyjjbntmj);

                map.put("gkfqdpzwh", gkfqdpzwh);
                map.put("gkfqdpwly", gkfqdpwly);
                map.put("gkfqdpzmj", gkfqdpzmj);
                map.put("gkfqdpzjg", gkfqdpzjg);
                map.put("gkfqdpzrq", gkfqdpzrq);
                map.put("gkfqdtdgypwlxejl", gkfqdtdgypwlxejl);
                map.put("gkfqdpwlb", gkfqdpwlb);
                map.put("gkfqdpznydmj", gkfqdpznydmj);
                map.put("gkfqdpzgdmj", gkfqdpzgdmj);
                map.put("gkfqdpzyjjbntmj", gkfqdpzyjjbntmj);


                map.put("bdcqzspzwh", bdcqzspzwh);
                map.put("bdcqzspwly", bdcqzspwly);
                map.put("bdcqzspzmj", bdcqzspzmj);
                map.put("bdcqzspzjg", bdcqzspzjg);
                map.put("bdcqzspzrq", bdcqzspzrq);
                map.put("bdcqzstdgypwlxejl", bdcqzstdgypwlxejl);
                map.put("bdcqzspwlb", bdcqzspwlb);
                map.put("bdcqzszpznydmj", bdcqzszpznydmj);
                map.put("bdcqzspzgdmj", bdcqzspzgdmj);
                map.put("bdcqzszyjjbntmj", bdcqzszyjjbntmj);


                map.put("ssnydpzwh", ssnydpzwh);
                map.put("ssnydpwly", ssnydpwly);
                map.put("ssnydpzmj", ssnydpzmj);
                map.put("ssnydpzjg", ssnydpzjg);
                map.put("ssnydpzrq", ssnydpzrq);
                map.put("ssnydtdgypwlxejl", ssnydtdgypwlxejl);
                map.put("ssnydpwlb", ssnydpwlb);
                map.put("ssnydpznydmj", ssnydpznydmj);
                map.put("ssnydpzgdmj", ssnydpzgdmj);
                map.put("ssnydpzyjjbntmj", ssnydpzyjjbntmj);


                map.put("tdzzyspzwh", tdzzyspzwh);
                map.put("tdzzyspwly", tdzzyspwly);
                map.put("tdzzyspzmj", tdzzyspzmj);
                map.put("tdzzyspzjg", tdzzyspzjg);
                map.put("tdzzyspzrq", tdzzyspzrq);
                map.put("tdzzystdgypwlxejl", tdzzystdgypwlxejl);
                map.put("tdzzyspwlb", tdzzyspwlb);
                map.put("tdzzyspznydmj", tdzzyspznydmj);
                map.put("tdzzyspzgdmj", tdzzyspzgdmj);
                map.put("tdzzyspzyjjbntmj", tdzzyspzyjjbntmj);


                map.put("qtpzwh", qtpzwh);
                map.put("qtpwly", qtpwly);
                map.put("qtpzmj", qtpzmj);
                map.put("qtpzjg", qtpzjg);
                map.put("qtpzrq", qtpzrq);
                map.put("qttdgypwlxejl", qttdgypwlxejl);
                map.put("qtpwlb", qtpwlb);
                map.put("qtpznydmj", qtpznydmj);
                map.put("qtpzgdmj", qtpzgdmj);
                map.put("qtpzyjjbntmj", qtpzyjjbntmj);

                map.put("lsydpzwh", lsydpzwh);
                map.put("lsydpwly", lsydpwly);
                map.put("lsydpzmj", lsydpzmj);
                map.put("lsydpzjg", lsydpzjg);
                map.put("lsydpzrq", lsydpzrq);
                map.put("lsydtdgypwlxejl", lsydtdgypwlxejl);
                map.put("lsydpwlb", lsydpwlb);
                map.put("lsydpznydmj", lsydpznydmj);
                map.put("lsydpzgdmj", lsydpzgdmj);
                map.put("lsydpzyjjbntmj", lsydpzyjjbntmj);


                map.put("tdgypzwh", tdgypzwh);
                map.put("tdgypwly", tdgypwly);
                map.put("tdgypzmj", tdgypzmj);
                map.put("tdgypzjg", tdgypzjg);
                map.put("tdgypzrq", tdgypzrq);
                map.put("tdgytdgypwlxejl", tdgytdgypwlxejl);
                map.put("tdgypwlb", tdgypwlb);
                map.put("tdgypznydmj", tdgypznydmj);
                map.put("tdgypzgdmj", tdgypzgdmj);
                map.put("tdgypzyjjbntmj", tdgypzyjjbntmj);


                map.put("xxydpzwh", xxydpzwh);
                map.put("xxydpwly", xxydpwly);
                map.put("xxydpzmj", xxydpzmj);
                map.put("xxydpzjg", xxydpzjg);
                map.put("xxydpzrq", xxydpzrq);
                map.put("xxydtdgypwlxejl", xxydtdgypwlxejl);
                map.put("xxydpwlb", xxydpwlb);
                map.put("xxydpznydmj", xxydpznydmj);
                map.put("xxydpzgdmj", xxydpzgdmj);
                map.put("xxydpzyjjbntmj", xxydpzyjjbntmj);


                map.put("yspzwh", yspzwh);
                map.put("yspwly", yspwly);
                map.put("yspzmj", yspzmj);
                map.put("yspzjg", yspzjg);
                map.put("yspzrq", yspzrq);
                map.put("ystdgypwlxejl", ystdgypwlxejl);
                map.put("yspwlb", yspwlb);
                map.put("yspznydmj", yspznydmj);
                map.put("yspzgdmj", yspzgdmj);
                map.put("yspzyjjbntmj", yspzyjjbntmj);


                map.put("isdel", "0");
                map.put("pch", pch);
                map.put("tbbh", map.get("dkbh").toString());
                map.put("xzqdm", xzqdm);
                map.put("submitdate", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));

//                map.put("dkzt", "1");
                Map<String, Object> map1 = new HashMap<>();
                if (map.get("dkbh").toString().equals(olddkbh)) {
                    rest = xjtbTbBaseMapper.updateDkxxb(map);
                }  //前期已经有了  直接更新
                else  //前期没有 则先删除 再合并
                {
                    String[] tbbhs = map.get("dkbh").toString().split(",");
                    if (tbbhs.length > 0) {
                        for (int k = 0; k < tbbhs.length; k++) {
                            String dkbh = tbbhs[k].toString();

                            map1.put("dkbh", dkbh);
                            int mm = xjtbTbBaseMapper.deleteDkxxbXjByDkbh(map1);//全部删除
                        }
                    }
                    map1.put("dkbh", map.get("dkbh").toString());
                    int mm = xjtbTbBaseMapper.deleteDkxxbXjByDkbh(map1);//全部删除
                    map.put("uid", UUID.randomUUID().toString().replace("-", ""));

                    rest = xjtbTbBaseMapper.addDkxxbXjData12(map);
                }
                if (rest > 0) {
                    map.put("czr", parm.get("czr"));
                    map.put("realname", parm.get("realname"));
                    map.put("czsj", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((new Date()).getTime()));
                    map.put("result", "合格");
                    map.put("userlevel", "县");
                    xjtbTbBaseMapper.saveDkxxbxjlz(map);
                }
            }
        }
        return rest;
    }

    @Override
    public List<Map<String, Object>> queryFjInfoByName(Map<String, Object> parm) {
        return xjtbTbBaseMapper.queryFjInfoByName(parm);
    }

    @Override
    public List<Map<String, Object>> queryZjggjxByPzwh(Map<String, Object> parm) {
        return xjtbTbBaseMapper.queryZjggjxByPzwh(parm);
    }

    @Override
    public List<Map<String, Object>> queryPwByPzwh(Map<String, Object> parm) {
        return xjtbTbBaseMapper.queryPwByPzwh(parm);
    }

    @Override
    public Integer deleteDkxjPwFj(Map<String, Object> parm) {
        Integer rest = 0;
        List<WpCjDkxxbxjPw2023DTO> wpCjDkxxbxjPw2023DTOS = xjtbTbBaseMapper.queryWpCjDkxxbxjPw2023(parm);
        if (wpCjDkxxbxjPw2023DTOS.size() > 0 && wpCjDkxxbxjPw2023DTOS != null) {
            String obsAddress = parm.get("OBSAddress") + "";
            for (int i = 0; i < wpCjDkxxbxjPw2023DTOS.size(); i++) {
                Map<String, Object> wpCjDkxxbxjPw2023DTO = (Map<String, Object>) wpCjDkxxbxjPw2023DTOS.get(i);
                String fjurl = wpCjDkxxbxjPw2023DTO.get("fjurl") + "";
                if (!"".equals(fjurl) && !"null".equals(fjurl)) {
                    StringBuilder sb = new StringBuilder();
                    String[] s = fjurl.split(",");
                    for (String url : s) {
                        if (url.indexOf(obsAddress) == -1) {
                            if (sb.length() > 0) {
                                sb.append(",");
                            }
                            sb.append(url);
                        }
                    }
                    Map<String, Object> map = new HashMap<>();
                    map.put("dkbh", parm.get("dkbh"));
                    map.put("pch", parm.get("pch"));
                    map.put("xzqdm", parm.get("xzqdm"));
                    map.put("sort", wpCjDkxxbxjPw2023DTO.get("sort"));
                    map.put("fjurl", sb.toString());
                    rest += xjtbTbBaseMapper.updateDkxjPwFj(map);
                }
            }
        }
        return rest;
    }


    @Override
    public List<YtbTbInfo> queryExportDkList(Map<String, Object> parm) {
        List<YtbTbInfo> rest = new ArrayList<>();
        //参数中 获取是否有dkzt
        List<Map<String, Object>> list = ytbTbInfoMapper.queryDkxxbxj(parm);
        for (Map<String, Object> map : list) {
            YtbTbInfo ytbTbInfo = new YtbTbInfo();

            ytbTbInfo.setIndex((Long) map.get("index"));
            ytbTbInfo.setJcbh(map.get("jcbh") + "");
            ytbTbInfo.setDkbh(map.get("dkbh") + "");
            ytbTbInfo.setPch(map.get("pch") + "");
            ytbTbInfo.setXzqdm(map.get("xzqdm") + "");
            ytbTbInfo.setPdlx(map.get("pdlx") + "");
            ytbTbInfo.setJtqx(map.get("jtqx") + "");
            ytbTbInfo.setJtlx(map.get("jtlx") + "");
            ytbTbInfo.setWflx(map.get("wflx") + "");
            ytbTbInfo.setSjyt(map.get("sjyt") + "");
            ytbTbInfo.setPdyjsm(map.get("pdyjsm") + "");
            ytbTbInfo.setDkzt(map.get("dkzt") + "");
            ytbTbInfo.setXian(map.get("xian") + "");
            ytbTbInfo.setWkt(map.get("wkt") + "");

            Map<String, Object> shiData = xjtbTbBaseMapper.queryShi(map);
            if (shiData!=null) {
                ytbTbInfo.setShiHcjl(shiData.get("hcjl")+"");
                ytbTbInfo.setShiHcsm(shiData.get("hcsm")+"");
                ytbTbInfo.setShiUsername(shiData.get("username")+"");
                ytbTbInfo.setShiRealname(shiData.get("realname")+"");
            }

            Map<String, Object> shengData = xjtbTbBaseMapper.querySheng(map);
            if (shengData!=null) {
                ytbTbInfo.setShengHcjl(shengData.get("hcjl")+"");
                ytbTbInfo.setShengHcsm(shengData.get("hcsm")+"");
                ytbTbInfo.setShengUsername(shengData.get("username")+"");
                ytbTbInfo.setShengRealname(shengData.get("realname")+"");
            }

            ytbTbInfo.setNydzypzwh(map.get("nydzypzwh") != null ? map.get("nydzypzwh") + "" : "");
            ytbTbInfo.setNydzypwly(map.get("nydzypwly") != null ? map.get("nydzypwly") + "" : "");
            ytbTbInfo.setNydzypzmj(map.get("nydzypzmj") != null ? map.get("nydzypzmj") + "" : "");
            ytbTbInfo.setNydzypzjg(map.get("nydzypzjg") != null ? map.get("nydzypzjg") + "" : "");
            ytbTbInfo.setNydzypzrq(map.get("nydzypzrq") != null ? map.get("nydzypzrq") + "" : "");
            ytbTbInfo.setZjggpzwh(map.get("zjggpzwh") != null ? map.get("zjggpzwh") + "" : "");
            ytbTbInfo.setZjggpwly(map.get("zjggpwly") != null ? map.get("zjggpwly") + "" : "");
            ytbTbInfo.setZjggpzmj(map.get("zjggpzmj") != null ? map.get("zjggpzmj") + "" : "");
            ytbTbInfo.setZjggpzjg(map.get("zjggpzjg") != null ? map.get("zjggpzjg") + "" : "");
            ytbTbInfo.setZjggpzrq(map.get("zjggpzrq") != null ? map.get("zjggpzrq") + "" : "");
            ytbTbInfo.setGkfqdpzwh(map.get("gkfqdpzwh") != null ? map.get("gkfqdpzwh") + "" : "");
            ytbTbInfo.setGkfqdpwly(map.get("gkfqdpwly") != null ? map.get("gkfqdpwly") + "" : "");
            ytbTbInfo.setGkfqdpzmj(map.get("gkfqdpzmj") != null ? map.get("gkfqdpzmj") + "" : "");
            ytbTbInfo.setGkfqdpzjg(map.get("gkfqdpzjg") != null ? map.get("gkfqdpzjg") + "" : "");
            ytbTbInfo.setGkfqdpzrq(map.get("gkfqdpzrq") != null ? map.get("gkfqdpzrq") + "" : "");
            ytbTbInfo.setBdcqzspzwh(map.get("bdcqzspzwh") != null ? map.get("bdcqzspzwh") + "" : "");
            ytbTbInfo.setBdcqzspwly(map.get("bdcqzspwly") != null ? map.get("bdcqzspwly") + "" : "");
            ytbTbInfo.setBdcqzspzmj(map.get("bdcqzspzmj") != null ? map.get("bdcqzspzmj") + "" : "");
            ytbTbInfo.setBdcqzspzjg(map.get("bdcqzspzjg") != null ? map.get("bdcqzspzjg") + "" : "");
            ytbTbInfo.setBdcqzspzrq(map.get("bdcqzspzrq") != null ? map.get("bdcqzspzrq") + "" : "");
            ytbTbInfo.setSsnydpzwh(map.get("ssnydpzwh") != null ? map.get("ssnydpzwh") + "" : "");
            ytbTbInfo.setSsnydpwly(map.get("ssnydpwly") != null ? map.get("ssnydpwly") + "" : "");
            ytbTbInfo.setSsnydpzmj(map.get("ssnydpzmj") != null ? map.get("ssnydpzmj") + "" : "");
            ytbTbInfo.setSsnydpzjg(map.get("ssnydpzjg") != null ? map.get("ssnydpzjg") + "" : "");
            ytbTbInfo.setSsnydpzrq(map.get("ssnydpzrq") != null ? map.get("ssnydpzrq") + "" : "");
            ytbTbInfo.setTdzzyspzwh(map.get("tdzzyspzwh") != null ? map.get("tdzzyspzwh") + "" : "");
            ytbTbInfo.setTdzzyspwly(map.get("tdzzyspwly") != null ? map.get("tdzzyspwly") + "" : "");
            ytbTbInfo.setTdzzyspzmj(map.get("tdzzyspzmj") != null ? map.get("tdzzyspzmj") + "" : "");
            ytbTbInfo.setTdzzyspzjg(map.get("tdzzyspzjg") != null ? map.get("tdzzyspzjg") + "" : "");
            ytbTbInfo.setTdzzyspzrq(map.get("tdzzyspzrq") != null ? map.get("tdzzyspzrq") + "" : "");
            ytbTbInfo.setQtpzwh(map.get("qtpzwh") != null ? map.get("qtpzwh") + "" : "");
            ytbTbInfo.setQtpwly(map.get("qtpwly") != null ? map.get("qtpwly") + "" : "");
            ytbTbInfo.setQtpzmj(map.get("qtpzmj") != null ? map.get("qtpzmj") + "" : "");
            ytbTbInfo.setQtpzjg(map.get("qtpzjg") != null ? map.get("qtpzjg") + "" : "");
            ytbTbInfo.setQtpzrq(map.get("qtpzrq") != null ? map.get("qtpzrq") + "" : "");
            ytbTbInfo.setLsydpzwh(map.get("lsydpzwh") != null ? map.get("lsydpzwh") + "" : "");
            ytbTbInfo.setLsydpwly(map.get("lsydpwly") != null ? map.get("lsydpwly") + "" : "");
            ytbTbInfo.setLsydpzmj(map.get("lsydpzmj") != null ? map.get("lsydpzmj") + "" : "");
            ytbTbInfo.setLsydpzjg(map.get("lsydpzjg") != null ? map.get("lsydpzjg") + "" : "");
            ytbTbInfo.setLsydpzrq(map.get("lsydpzrq") != null ? map.get("lsydpzrq") + "" : "");
            ytbTbInfo.setTdgypzwh(map.get("tdgypzwh") != null ? map.get("tdgypzwh") + "" : "");
            ytbTbInfo.setTdgypwly(map.get("tdgypwly") != null ? map.get("tdgypwly") + "" : "");
            ytbTbInfo.setTdgypzmj(map.get("tdgypzmj") != null ? map.get("tdgypzmj") + "" : "");
            ytbTbInfo.setTdgypzjg(map.get("tdgypzjg") != null ? map.get("tdgypzjg") + "" : "");
            ytbTbInfo.setTdgypzrq(map.get("tdgypzrq") != null ? map.get("tdgypzrq") + "" : "");
            ytbTbInfo.setXxydpzwh(map.get("xxydpzwh") != null ? map.get("xxydpzwh") + "" : "");
            ytbTbInfo.setXxydpwly(map.get("xxydpwly") != null ? map.get("xxydpwly") + "" : "");
            ytbTbInfo.setXxydpzmj(map.get("xxydpzmj") != null ? map.get("xxydpzmj") + "" : "");
            ytbTbInfo.setXxydpzjg(map.get("xxydpzjg") != null ? map.get("xxydpzjg") + "" : "");
            ytbTbInfo.setXxydpzrq(map.get("xxydpzrq") != null ? map.get("xxydpzrq") + "" : "");
            ytbTbInfo.setYspzwh(map.get("yspzwh") != null ? map.get("yspzwh") + "" : "");
            ytbTbInfo.setYspwly(map.get("yspwly") != null ? map.get("yspwly") + "" : "");
            ytbTbInfo.setYspzmj(map.get("yspzmj") != null ? map.get("yspzmj") + "" : "");
            ytbTbInfo.setYspzjg(map.get("yspzjg") != null ? map.get("yspzjg") + "" : "");
            ytbTbInfo.setYspzrq(map.get("yspzrq") != null ? map.get("yspzrq") + "" : "");

            if (map.get("thdkmj") != null) {
                if (map.get("thdkmj").toString() != "" && map.get("thdkmj").toString() != null) {
                    ytbTbInfo.setThdkmj(Double.parseDouble(map.get("thdkmj").toString()));
                }
            }
            if (map.get("thdkgdmj") != null) {
                if (map.get("thdkgdmj").toString() != "" && map.get("thdkgdmj").toString() != null) {
                    ytbTbInfo.setThdkgdmj(Double.parseDouble(map.get("thdkgdmj").toString()));
                }
            }
            if (map.get("thdkzjbntmj") != null) {
                if (map.get("thdkzjbntmj").toString() != "" && map.get("thdkzjbntmj").toString() != null) {
                    ytbTbInfo.setThdkzjbntmj(Double.parseDouble(map.get("thdkzjbntmj").toString()));
                }
            }
            if (map.get("thnydmj") != null) {
                if (map.get("thnydmj").toString() != "" && map.get("thnydmj").toString() != null) {
                    ytbTbInfo.setThnydmj(Double.parseDouble(map.get("thnydmj").toString()));
                }
            }

            if (!"".equals(map.get("tbdkmj") + "")) {
                ytbTbInfo.setTbdkmj(Double.parseDouble(map.get("tbdkmj") + ""));
            }
            if (!"".equals(map.get("tbdkqzgdmj") + "")) {
                ytbTbInfo.setTbdkqzgdmj(Double.parseDouble(map.get("tbdkqzgdmj") + ""));
            }
            if (!"".equals(map.get("tbdkqzjbntmj") + "")) {
                ytbTbInfo.setTbdkqzjbntmj(Double.parseDouble(map.get("tbdkqzjbntmj") + ""));
            }
            if (!"".equals(map.get("tbnydmj") + "")) {
                ytbTbInfo.setTbnydmj(Double.parseDouble(map.get("tbnydmj") + ""));
            }
            if (!"".equals(map.get("tbdkstmj") + "")) {
                ytbTbInfo.setTbdkstmj(Double.parseDouble(map.get("tbdkstmj") + ""));
            }
            if (!"".equals(map.get("tbdkstbhhxmj") + "")) {
                ytbTbInfo.setTbdkstbhhxmj(Double.parseDouble(map.get("tbdkstbhhxmj") + ""));
            }
            String jcbh = map.get("jcbh") + "";
            Map<String, Object> tbxxbxj = new HashMap<>();
            if (jcbh.indexOf(",") != -1) {
                String[] s = jcbh.split(",");
                tbxxbxj = ytbTbInfoMapper.queryTbxxbxj(s[0]);
            } else {
                tbxxbxj = ytbTbInfoMapper.queryTbxxbxj(jcbh);
            }

            if (tbxxbxj != null) {
                ytbTbInfo.setTblx(tbxxbxj.get("tblx") + "");
                ytbTbInfo.setSheng(tbxxbxj.get("smc") + "");
                ytbTbInfo.setShi(tbxxbxj.get("smc1") + "");
                ytbTbInfo.setXian(tbxxbxj.get("qxmc") + "");
                ytbTbInfo.setXz(tbxxbxj.get("mjzbzddxzjxzqmc") + "");
                ytbTbInfo.setCun(tbxxbxj.get("mjzbzddcjxzqmc") + "");
            }
            rest.add(ytbTbInfo);
        }
//        return ytbTbInfoMapper.queryYtbTbInfo(parm);
        return rest;
    }

}
